Snagit 11 advanced COM automation

  • 1
  • Question
  • Updated 4 years ago
I'm hoping someone can help me get over a hump with test automation that includes Snagit COM automation. I am developing solutions in PowerShell and Ruby for accessing websites and running Wave and W3C validations and creating summary reports. This is replacing a manual process that has been going on for a couple years, but is very time consuming for our quality control team. I have managed to automate all the testing, and have gotten to the point of having Snagit capture the results. However, the next step is to send those results to the Snagit Printer, but not using the system default. I got as far as telling Snagit I don't want to use the default printer, but can't seem to set the output to the Adobe PDF printer. Yes, I have been successful outputting to the pdf file type, but there's a very big difference in PDF layout that is unacceptable. Anyone have success with advanced usage of Output and OutputPrinterOptions? The COM documentation and examples deal mostly with pretty common basic tasks. I've even resorted to Windows OLE and Windows API (wit Ruby) to take control of the Editor Window and use keystroke emulation without success.
Photo of David Brumage

David Brumage

  • 1 Post
  • 0 Reply Likes

Posted 4 years ago

  • 1
Photo of Adam Marks

Adam Marks, Software Developer

  • 124 Posts
  • 13 Reply Likes
Hello David,

I have not tried this specific workflow with the Snagit COM API so I can't say for sure that it will work, but you can try this :

It looks like the IPrinterOptions interface has a SetData() call on it that takes 3 params to set the printer. The three params are PrinterName, DriverName, and Port.

To get the values for these parameters, use Snagit to create a new profile that outputs to the printer that you want to output to( the Adobe PDF printer ), save that profile, export the profiles and then look at that exported XML in a text editor. Look for the following 3 values for your printer:

For my "Send to OneNote" printer, my Printer name is "Send To OneNote 16", my Driver name is "winspool" and my Port is "nul:"

These are the values you would try in that SetData() call.

Thanks,
Adam

This conversation is no longer open for comments or replies.