Registering and Un-registering Callback Functions

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:

L_PrnSetPrinterSpecifications

L_PrnGetPrinterSpecifications

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:

L_PrnInstallPrinter

L_PrnUninstallPrinter

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:

The following functions are callback functions:

PRNEMFRGSPROC

PRNJOBINFOPROC

L_PrnRegisterEMFCallback

L_PrnRegisterJobCallback

L_PrnUnRegisterEMFCallback

L_PrnUnRegisterJobCallback

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.

Help Version 21.0.2021.7.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Virtual Printer C API Help

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.