Working with the LEADTOOLS Virtual Printer Driver

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.

Install and uninstall LEADTOOLS Virtual Printers by using the following functions:

L_PrnInstallPrinter

L_PrnUninstallPrinter

Before installing, fill the PRNPRINTERINFO  structure with appropriate values. Use the L PrnGetPrinterInfo to get the information used when the printer was installed.. Free the information obtained by calling L PrnGetPrinterInfo by calling L_PrnFreePrinterInfo.

By default LEADTOOLS Virtual Printers are unlocked and any application can print directly to it. Only printers that were originally created with a password can be locked. Implement the ability to lock the printer during installation by filling the pszPassword member of the PRNPRINTERINFO structure with the password to be used. Lock the printer to prevent other applications from printing directly to it by calling the L_PrnLockPrinter function.

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:

These callback functions are:

PRNEMFRGSPROC Function

PRNJOBINFOPROC Function

Before using the EMF callback function, you must register it using the L_PrnRegisterEMFCallback function. When this callback function no longer needs 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 this callback function no longer needs 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.