How to use easy PDF SDK's Virtual Printer to enable File & Print function in your application?
Last Updated: 3/11/2014
Although BCL's PDF SDK adds a Virtual Printer during installation, this PDF Printer is not a fully fledged printable device by default, but rather just an interpreter application for our PDF SDK to work through. By Default, if you send a job to the PDF Printer via File->Print it will not be processed, there will be no request for an output filename, the PDF print job will simply be placed into the Printers Queue and do nothing. It should not negatively impact subsequent jobs, however it also will not create a PDF file and can cause issues if you try to uninstall the PDF SDK.
In order to use BCL's PDF SDK printer from the File->Print Menu you need an actively Running PrinterMonitor object. This object allows BCL's PDF SDK to throw events at all of the major points of the Printing Job, meaning it allows BCL's PDF SDK to detect when a file is sent to the Print Queue. It is also able to detect when other major events happen and is how our Samples Can track exactly what page the conversion is currently processing.
A Sample of the PrinterMonitor object is available with the other PDF SDK samples, under PDF C#->PrinterMonitorTest. Alternatively, there are several different PDF C++ PrinterMonitors under Visual C++. Specifically, Client, Tray, and Event all use the PrinterMonitor object in different ways to allow the use of the File->Print Menu.
Other Tips regarding the PDF SDK's Virtual Printer:
- The PDF SDK Printer should be the system default. Some systems may try to prevent the PDF SDK from changing which printer is selected or the default, which may prevent the PDF SDK from functioning. Certain Applications such as Internet Explorer are especially vulnerable to this.
- If the Loader Service is not properly configured you may wind up with documents stuck in the Printer's Queue. Although these should not cause issues to subsequent conversions, they should still be cleaned out during general server maintenance, when no conversions are ongoing.
- Like other Printers, BCL's PDF SDK Printer can only have one set of Printer Settings applied to it at a single time. This is why the PDF API PrinterSetting.Save() method is not safe, because they have to change the User's Settings for the Printer in order to take effect. This is also why the settings continue to apply after the application has been closed.