The LEADTOOLS Virtual Printer Driver is a virtual printer that can be controlled by applications.
Use the following functions to get or set LEADTOOLS Virtual Printer options:
To determine whether a printer is a LEADTOOLS Virtual Printer Driver, call the L_PrnIsLeadtoolsPrinter function.
Before installing a driver, fill the PRNPRINTERINFO structure with appropriate values.
Install and uninstall LEADTOOLS Virtual Printers by using the following functions:
By default LEADTOOLS Virtual Printers are unlocked and any application can print directly to it. However, it is possible to lock the printer to prevent other applications from printing directly to it by calling the L_PrnLockPrinter function.
Note: Only printers that were originally created with a password can be locked.
If the printer is locked, when a user tries to print directly to the printer a message box displays saying that printer is locked.
To unlock a printer, call the L_PrnUnlockPrinter function.
To determine whether applications were prevented from directly printing to the specified LEADTOOLS Virtual Printer, call the L_PrnIsPrinterLocked function
The LEADTOOLS Virtual Printer Driver provides callback functions for the following operations:
Getting a print job as an EMF data file
Getting print job information
The following functions are callback functions:
Before using the EMF callback function, you must register it using the L_PrnRegisterEMFCallback function. When the user no longer needs this callback function to be fired, it must be unregistered by calling the L_PrnUnRegisterEMFCallback function.
Before using the job callback function, you must register it using the L_PrnRegisterJobCallback function. When the user no longer needs this callback function to be fired, it must be unregistered by calling the L_PrnUnRegisterJobCallback function.
Your executable can sink on the events for multiple printers at the same time. Simply use multiple calls to L_PrnRegisterEMFCallback and L_PrnRegisterJobCallback, passing different printer's names for the pszPrinterName parameter in each call.