Files to be Included with your LEADTOOLS Virtual Printer Driver Application

Files for redistribution are included in the LEADTOOLS SDK's installation directory for the supported platform.

Legal Notices

Note: You may not copy or redistribute any of the following files without obtaining the proper license. In some cases, the license is included with your initial purchase of LEADTOOLS. In other cases, you must obtain a license from a third party or enter into a royalty agreement with LEAD to obtain the proper license. For these special licensing situations, see the notes below accompanying the specific file.

Note: You may not distribute the header files with your application, and you may not provide software development capabilities in your application.

LTKRN is required for ALL C API applications.

LTKRN and LTWVC are required for ALL C++ Class Library applications.

Note: Most of the LEADTOOLS Windows DLLs are compiled with Visual Studio 2017 and are linked statically to the Microsoft Visual C++ 2017 Runtime.
The Microsoft Visual C++ 2017 Redistributable Package cannot be installed on some versions of Windows. For supported versions, see Choosing a Deployment Method and Update for Universal C Runtime in Windows. The Microsoft Visual C++ 2017 Runtime also requires the Windows Universal CRT library, which is distributed as part of Windows 10. For information on how to redistribute the universal CRT, see Introducing the Universal CRT. Only the following DLLs are compiled with requirements for specific versions of the Microsoft Visual C++ Runtime:

Note: For more information about distributing the Microsoft C/C++ runtime files, refer to: https://learn.microsoft.com/en-us/visualstudio/releases/2017/2017-redistribution-vs.

The following table summarizes the files you must include with your distribution. Most files in the table are optional. These files are referred to as "Redistributables" in the License Agreement.

Note: XP / Server 2003: If running within a service on an XP or Server 2003 machine you may run into an issue where the printer installs but does not receive the events. This is a result of the default DCOM authentication settings. To correct this, go to Start > Run and enter "dcomcnfg". Then right-click Component Services > Computers > My Computer and select properties. On the Default Properties tab, select "None" for the Default Authentication Level.

Destination Directory Structure Specification

Call the L_PrnInstallPrinter function to install the LEADTOOLS Virtual Printer Module. Pass the PRNPRINTERINFO structure to this function. Use the pszRootDir member of the PRNPRINTERINFO structure to specify the root folder in which to install the LEADTOOLS Virtual Printer. (For convenience, the root folder will be written as "<PRNPRINTERINFO-pszRootDir>" throughout the rest of this topic). The folder should contain two sub-folders:

Note: All users of the virtual printer must have access to the folder passed to the pszRootDir member.

Details regarding the directory structure and content are shown below.

\Spool

The virtual printer uses the Spool folder to store temporary files that are generated while printing.

\Bin

The Bin folder should contain the following files:

The LeadtoolsPrinter.exe executable file. It is located in the <installationdir>\Bin\Common\PrinterDriver\Bin\ directory, where <installationdir> is the directory in which you installed the LEADTOOLS toolkit.

Copy LeadtoolsPrinter.exe to the <PRNPRINTERINFO-pszRootDir>\Bin directory. The file is required for all operating systems.

The required COM Server files. The COM Server files are located in the <installationdir>\Bin\Common\PrinterDriver\ directory, where <installationdir> is the directory in which you installed the LEADTOOLS toolkit. These files are required for all Operating Systems. Copy the following files to the <PRNPRINTERINFO-pszRootDir>\Bin directory:

Redistributables Explanation Files
LPCLB LEADTOOLS Printer COM server. Register using regsvr32 (regsvr32 LPCLB06N.DLL). LPCLB06N.DLL
LPCMG LEADTOOLS Printer COM Server. Register using /RegServer (LPCMG06N /Regserver) LPCMG06N.exe
LPWSE LEADTOOLS Printer COM Server. Register using /RegServer (LPWSE06N /Regserver) and unregister using /UnRegServer (LPWSE06N /UnRegServer). LPWSE06N.EXE
LPCPN LEADTOOLS Printer COM server. Register using regsvr32(regsvr32 LPCPN06N.DLL). LPCPN06N.dll
LPPRNCON LEADTOOLS Printer COM server. Register using regsvr32 (regsvr32 LPPRNCON.DLL). LPPRNCON.DLL
LpPrinterThunk.exe LEADTOOLS Printer COM Server. Register using /RegServer (LpPrinterThunk /Regserver) and unregister using /UnRegServer (LpPrinterThunk / UnRegServer). LpPrinterThunk.exe

Target Setups

The rest of the installation depends upon how the destination machine is configured. There are four possible configurations:

Required DLLs for 32-bit Operating Systems (system32) Target Setups: (32-bit CPU or 64-bit CPU), 32-bit OS, 32-bit Application

These files can be found in the <installationdir>\Bin\Common\PrinterDriver\Driver\i386\ directory, where <installationdir>represents the directory in which you installed the LEADTOOLS toolkit.

Copy the following 32-bit Drivers to the System32 folder as shared files. These files should be deployed only for 32-bit operating systems.

Redistributables Explanation Files
LPDRV 32-bit Driver DLL LPDRV06N.DLL
LPUID 32-bit Driver DLL LPUID06N.DLL
LPPMN 32-bit Port DLL LPPMN06U.DLL

Required DLLs for 64-bit Operating Systems (system32) Target Setups: 64-bit CPU, 64-bit OS, (64-bit Application or 32-bit Application)

These files can be found in the <installationdir>\Bin\Common\PrinterDriver\Driver\amd64\ directory, where <installationdir>, represents the directory in which you installed the LEADTOOLS toolkit.

64-bit Operating Systems: Unless otherwise noted, all 32-bit files should be deployed to the SysWow64 folder and 64-bit files should be deployed to the System32 folder as shared files.

These files should be deployed only for 64-bit operating systems.

Copy the following files to the System32 folder as shared files:

Redistributables Explanation Files
LPDRV 64-bit Driver DLL LPDRV06x.DLL
LPUID 64-bit Driver DLL LPUID06x.DLL
LPPMN 64-bit Port DLL LPPMN06x.DLL

Copy the following files to the SysWow64 folder:

Redistributables Explanation Files
LPDRV (32-bit Drivers), needed only for network printers. Driver DLL LPDRV06N.DLL
LPUID (32-bit Drivers), needed only for network printers. Driver DLL LPUID06N.DLL

Printer Driver INF installation for Windows Vista and later:

After an application is developed and ready to redistribute, create a setup.exe that includes all of the necessary files.

Use the following function to install the LEADTOOLS Virtual Printer Driver INF:

#define UPDP_UPLOAD_ALWAYS      0x00000002L 
typedef HRESULT (*pUPLOADPRINTERDRIVERPACKAGE)(LPCTSTR pszServer,LPCTSTR pszInfPath,LPCTSTR pszEnvironment,DWORD dwFlags,HWND hwnd,LPTSTR pszDestInfPath,PULONG pcchDestInfPath); 
typedef HRESULT (WINAPI * pINSTALLPRINTERDRIVERFROMPACKAGE) (LPCTSTR, LPCTSTR, LPCTSTR, LPCTSTR, DWORD); 
L_INT InstallDriverPackage(const L_WCHAR* pszInfPath, const L_WCHAR* pszEnvironment) 
{ 
   L_INT nRet = FAILURE; 
   HINSTANCE hInstance = LoadLibrary("Winspool.drv"); 
   if (hInstance == NULL) 
   { 
      return nRet; 
   } 
   pUPLOADPRINTERDRIVERPACKAGE pUploadPackage = (pUPLOADPRINTERDRIVERPACKAGE)GetProcAddress(hInstance, "UploadPrinterDriverPackageW"); 
   if (pUploadPackage != NULL) 
   { 
      TCHAR szDestInfPath[512]; 
      DWORD dwDestLen = 512; 
      HRESULT hr = pUploadPackage(NULL,A2W(pszInfPath), pszEnviroment, UPDP_UPLOAD_ALWAYS, GetDesktopWindow(), szDestInfPath, &dwDestLen); 
      if(hr == S_OK) 
      { 
         pINSTALLPRINTERDRIVERFROMPACKAGE pInstallPrinterDriverFromPackage = (pINSTALLPRINTERDRIVERFROMPACKAGE)GetProcAddress((HMODULE)hInstance, "InstallPrinterDriverFromPackageW"); 
         if(pInstallPrinterDriverFromPackage != NULL) 
         { 
            hr = pInstallPrinterDriverFromPackage(NULL, szDestInfPath, L"LEADTOOLS VIRTUAL PRINTER", pszEnvironment, 0); 
            if(hr == S_OK) 
               nRet = SUCCESS; 
         } 
      } 
   } 
   FreeLibrary(hInstance); 
   return nRet; 
} 

Install the 32-bit driver package by calling:

InstallDriverPackage(Bin\\Common\\PrinterDriver\\Driver\\LeadtoolsVirtualPrinter.INF, L"Windows NT x86"); 

Install the 64-bit driver package by calling:

InstallDriverPackage(Bin\\Common\\PrinterDriver\\Driver\\LeadtoolsVirtualPrinter.INF, L"Windows x64"); 

Note: For Network printing, it is possible to install both packages (x86 and x64) on the Server machine in order to support both types of client machines.

LEADTOOLS SDK Platform and Application-Specific Redistributables

  Description
Application-Specific For LEADTOOLS SDK core redistributables requirement of the exact assemblies and libraries to use on a specific platform and application, refer to the Files to be Included.
Application-Java-Specific For LEADTOOLS SDK core redistributables requirement of the exact assemblies and libraries to use on Java platforms and applications, refer to the Files to be Included and Files to be Included with your Java Application.
Assembly Directory For LEADTOOLS SDK installation directory information, refer to Installation Directory.
Licensing For licensing information, refer to LEADTOOLS Runtime Licensing and LEADTOOLS Runtime Licensing FAQ
Help Version 22.0.2022.12.7
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Virtual Printer C API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.