Virtual Printer Driver – Developer Manual


Virtual Printer SDK:       Home       Download       Pricing       FAQ       Manual       Tutorials       Known issues       News

 

– Download Developer Manual as PDF –

Table of Contents:

Overview
Getting Started
Environment variables and custom variables
Agent
     Agent Settings
Authentication
     Authentication Settings
Applications
     Preconverter
     Postconverter
     Application Settings
     Early Access
Converter
     Converter Settings
     EMF
     BMP
     PNG
     JPEG
     TIFF
     RAW
     INI
     FTP
     PDF
     POS
     Redirect
     Text
     Watermarks
Installation Directory Settings
Properties Dialog Settings
For Developers
     Binaries overview
     Building MSI package
          Using Microsoft Visual Studio
          Using Wix tools
     Building executable package
          NSIS
          Inno Setup
The Driver Pipeline
Legal and Copyright Notices

 

Overview

The Virtual Printer Driver is a usual printer device in the system. You may print on them from any application, setup printer settings such as DPI, paper size and page orientation. Instead of the real printer device that prints on a real paper, VPD produce copy of the printed document in different formats such as JPEG, PNG, PDF or TEXT. In other words, VPD is a complete solution for documents conversion to other formats with abilities to control conversion process. Moreover, there is an option to notify the specified client application with path to an INI-file that contains:

  • Print job information (User name, Job ID, Paper size, Page orientation, etc.);
  • Output files information (File format, count, paths).

There is no limitations for the client application logic. It can be a desktop application which popup login dialog and upload files to the cloud via your web-service API. Or it can be a hidden console application that saves files with metadata on the server and calculates user statistics.

 

Getting Started

The Virtual Printer Driver delivery package contains:

  • Binary files for printer driver. Detailed files information here.
  • Installation scripts for making your own installation package. How to build MSI and EXE package you will find here and here.

There are three parts of the Virtual Printer Driver:

Agent service and Converter are non-modifiable components but provides a various settings for configuration. Application is a part of your software package and should implement your business logic. There are only two limitations for the application:

  1. It should be executable. It can be an EXE-file by itself or a parameter of an interpreter, for example “java.exe -jar app.jar”;
  2. It should receive notifications from Agent service through command line or Windows message or named pipe.

For tests, you may build and install a sample installation from the delivery package or install DEMO build from x86 or x64 packages. After the installation completed, use Properties utility from the driver group in the Start menu or registry settings to configure application settings, output formats, general printer settings (paper size, print quality, page orientation), etc.

When your software package will be ready for deployment, you may start to create a custom installation package. It can be EXE-file or MSI-package. You may use this installation files as a part of your installer or modify them for installing your part of software.

 

Environment variables and custom variables

Using System environment variables, output directory or output file name can be configured. Virtual Printer Driver supports all of them that can be specified with %variable_name% template. In addition to System environment variables, Virtual Printer Driver supports custom variables that can be specified with {variable_name} template. For example, output directory “%TEMP%/{yyyy}/{device}” will expand to “C:/Users/John/AppData/Local/Temp/2017/Two Pilot Demo Printer” directory.

Here is the list of supported custom variables:

Custom variables
Name Description
{device} Device name
{user} User name
{machine} Machine name
{document} Document title
{yyyy} Year
{yy} Year, last two digits
{M} Month
{MM} Month with leading zero
{D} Day
{DD} Day with leading zero
{h} Hour
{hh} Hour with leading zero
{m} Minute
{mm} Minute with leading zero
{s} Second
{ss} Second with leading zero
{job} Print job ID
{job0N} Print the job ID with leading zeros and the specified number of N characters in the range [3..5]
{page} Page number
{page0N} Page number with leading zeros and a given number of N characters in the range [3..5]
{sid} User session ID

 

Agent

Agent is a Windows service which allows to communicate between Virtual Printer Driver and client applications. In services list it named as VPDAgent. By default Agent calls applications with a logged on user permission rights who prints documents. If Virtual Printer Driver shared via local network or domain you should use Allow guest session or Allow domain session options for allowing to call an application with a current logged on user permission rights. If Virtual Printer Driver installed on a print-server and there are no logged on users you should use Allow self session which allows to call applications with Agent service permission rights without any interactives (GUI).

By default, Agent scheduler uses pool size with 8 simultaneous threads, one thread – one print job. You can change this value by passing “-poolSize X” command line parameter via VPDAgent service property “Start parameter:”, where “X” is a required pool size.

Agent settings are stored in the following registry key:
«HKLM\Software\REGISTRY_ENTRY\Agent»

 

Agent Settings

HKLM\Software\REGISTRY_ENTRY\Agent
Option name Type Description Value Default value
Allow guest session REG_DWORD This option enables execute applications with current logged on user permission rigths if Guest session was detected. 0 – disable
1 – enable
0
Allow domain session REG_DWORD This option enables execute applications with current logged on user permission rights if Domain session was detected. 0 – disable
1 – enable
0
Allow self session REG_DWORD This option enables execute applications with the Agent service permission rights (SYSTEM by default) w/o any GUI. 0 – disable
1 – enable
0

 

Authentication

Virtual Printer Driver supports user authentication through OAuth v2.0 protocol. This feature allows to deny unauthorized access to the Virtual Printer Driver and the services provided. Before using Virtual Printer Driver each user should provide a valid credentials for authentication service.

Authentication settings are stored in the following registry key:
«HKLM\Software\REGISTRY_ENTRY\Agent\OAuth v2.0»

 

Authentication Settings

HKLM\Software\REGISTRY_ENTRY\Agent\OAuth v2.0
Option name Type Description Value Default value
Enabled REG_DWORD This option enables authentication. 0 – disable
1 – enable
0
URL REG_SZ Authorization service URL    
Client ID REG_SZ This is a publicly exposed string that is used by the service API to identify the application, and is also used to build authorization URLs that are presented to users.    
Client Secret REG_SZ This is used to authenticate the identity of the application to the service API when the application requests to access a user’s account, and must be kept private between the application and the API.    
Ignore certificate error REG_DWORD This option allows to ignore SSL certificate errors. 0 – do not ignore
1 – ignore
1
Remove unauthorized job REG_DWORD This option allows to remove unauthorized print jobs from the printer queue. 0 – do not remove
1 – remove
1

 

Applications

Application is an executable file (exe-file) which called by Agent service during a processing of a print job. There are two types of applications: preconverter and postconverter. Preconverter allows to handle EMF files before processing to other formats. Postconverter allows to handle a result of EMF files processing to BMP, JPEG, TIFF, PNG, TEXT or PDF formats.

 

Preconverter

Using the preconverter you can modify or remove the EMF files in print job and alter conversion settings. When the driver runs the preconverter, this information is available:

  • document name
  • job id
  • machine name
  • user name
  • print resolution
  • paper orientation
  • paper size
  • bin name
  • pages
  • EMF files

Using this data the preconverter can stop or resume the print job. To resume the print job the preconverter should put this section in the ini-file:
[Preconverting]
Status = resumed

To cancel the print job, this section:
[Preconverting]
Status = canceled

Preconverter settings are stored in the following registry keys:
«HKCU\Software\REGISTRY_ENTRY\Application\Preconverter»
«HKLM\Software\REGISTRY_ENTRY\Application\Preconverter»

 

Postconverter

Postconverter (or the client application) is started at the end of the print job processing. When the driver runs the postconverter, this information is available:

  • document name
  • job id
  • machine name
  • user name
  • print resolution
  • paper orientation
  • paper size
  • bin name
  • pages
  • full paths to EMF, BMP, TIFF, JPEG, PNG, TEXT, PDF files.

Postconverter settings are stored in the following registry keys:
«HKCU\Software\REGISTRY_ENTRY\Application\Postconverter»
«HKLM\Software\REGISTRY_ENTRY\Application\Postconverter»

 

Application Settings

HKLM\Software\REGISTRY_ENTRY\Application\Preprocessor
{HKLM, HKCU}\Software\REGISTRY_ENTRY\Application\Preconverter
{HKLM, HKCU}\Software\REGISTRY_ENTRY\Application\Postconverter
Option name Type Description Value Default value
Enabled REG_DWORD This option enables component. 0 – disable
1 – enable
0
Early Access REG_DWORD Execute application at spooling time and notify about changes in run-time. Works only with WM_COPYDATA and named pipe Transfer Mode. 0 – disable
1 – enable
0
Executable File REG_SZ Full path to the application EXE-file, may include system environment variables.    
Transfer Mode REG_DWORD Type of the communication between Agent and component application. 0- through the command line
1- through the WM_COPYDATA
2- none
3- through the named pipe
 
Skip Mode REG_DWORD This option enables to skip component application call for EMF/RAW data. 0 – allows application call for EMF/RAW
1- disable application call for EMF
2- disable application call for RAW
0
Window Title REG_SZ Title of the component application window.    
Timeout REG_DWORD Timeout value in ms after the component application launch.    
Window Class REG_SZ Class of the component application window.    
Message Id REG_DWORD Unique numeric value to identify that the notification message has been received from the printer driver.
For the WM_COPYDATA transfer mode this value represents dwData member of COPYDATASTRUCT structure.
   
Notify All REG_DWORD Notify all top-level windows with WM_COPYDATA message. 0 – don’t notify
1 – notify
0
Pipe Name REG_SZ Unique pipe name for ini-file transfer to the component application.    
Pipe Message Size REG_DWORD Pipe message size.    
Pipe Launch Application REG_DWORD This option allows to launch the component application or skip it. 0 – don’t launch an application
1 – launch an application
 

 

Early Access

Early Access allows to receive information from Virtual Printer Driver in run-time. In this mode, Virtual Printer Driver sends to the Application packages with required information. Packages sends according to the next scheme:

  • The first package contain a path to the INI-file and a “Document” section of the INI-file contain “Status” equal to “Spooling”:
         [Document]
         Status = Spooling
     
  • The second and all the next packages contains paths to converted files with zero (‘\0’) as delimiter and double zero at the end of the package. For example, “printer name\0jobid\0c:\Output\result.emf\0c:\Output\result.bmp\0c:\Output\result.png\0\0”. Paths to multipage formats (TIFF, PDF and Text) sends before the last package;
     
  • The last package contain path to INI-file and the “Document” section of the INI-file contain “Status” equal to “Printed”:
         [Document]
         Status = Printed

To enable “Early Access” you should add “Application/Postconverter/Early Access”, REG_DWORD value and set to “1”.

 

Converter

Converter performs conversion of EMF files to BMP, JPEG, TIFF, PNG, TEXT or PDF formats. If a source format is ESC/POS, it is converted to the EMF first, then to other formats. Also converter allow to add graphical and textual watermarks to produced files, redirect a print job to other printer or upload produced files to FTP/SFTP/FTPS server. All produced files are stored in the output directory.

Converter settings are stored in the following registry keys:
«HKCU\Software\REGISTRY_ENTRY\Converter»
«HKLM\Software\REGISTRY_ENTRY\Converter»

Target format settings for BMP, JPEG, TIFF, PNG, TEXT, PDF, POS, FTP, WATERMARKS and REDIRECTION are stored in corresponding subkeys.

 

Converter Settings

{HKLM, HKCU}\Software\REGISTRY_ENTRY\Converter
Option name Type Description Value Default value
Enabled REG_DWORD This option enables Converter. 0 – disable
1 – enable
1
Threads REG_DWORD This option sets thread pool size for emf2bmp/jpeg/png/tiff/pdf converters.   2
Cleanup Output REG_DWORD Cleanup output directory after processing. 0 – do not cleanup
1 – cleanup
0
Show Progress REG_DWORD This options enables show or hide progress bar. 0 – disable
1 – enable
1
Output Directory REG_SZ Path to the output directory, may include system environment variables and custom variables. Use a canonical path for a network mounted device, i.e.
“\\server\shared\output” instead of “x:\output”.
   
File name mask REG_SZ Mask for the output file name, may include custom variables.   {yyyy}{MM}{DD}{hh}{mm}{ss}{job05}{page03}
Pages Per Sheet REG_DWORD Number of pages per sheet. 1 – one page per sheet
2 – two pages per sheet
4 – four pages per sheet
6 – six pages per sheet
9 – nine pages per sheet
16 – sixteen pages per sheet
1
Draw Borders REG_DWORD Draw borders for each page per sheet. 0 – do not draw
1 – draw
0

 

EMF

{HKLM, HKCU}\Software\REGISTRY_ENTRY\Converter\EMF
Option name Type Description Value Default value
Enabled REG_DWORD This option enables producing of EMF files. 0 – disable
1 – enable
1
Normalize lines REG_DWORD This option enables lines width normalization. If a line logical width is out of range [Thin line width .. Thick line width] then it assigns to margin value. 0 – disable
1 – enable
0
Thin line width REG_DWORD Minimal line logical width. All thinner lines draws with this value.   1
Thick line width REG_DWORD Maximal line logical width. All thicker lines draws with this value.   20
Cut document REG_DWOD This option enables cut space area from the bottom of the document. 0 – disable
1 – enable
0
Extra bottom space REG_DWORD Extra space at the bottom after cut, in tenths of a millimeter.   50
Store embedded fonts REG_DWORD

This option enables embedded font storing on a disk. The output INI-file will contain Font section:

[Font]
Count=3
Font0=C:\…\Output\Fonts\Z@R6467.tmp.ttf
Font1=C:\…\Output\Fonts\Z@R6621.tmp.ttf
Font2=C:\…\Output\Fonts\Z@R68C7.tmp.ttf

0 – disable
1 – enable
0
Store system fonts REG_DWORD This option enables system fonts storing on a disk. 0 – disable
1 – enable
0
Embedded fonts directory REG_SZ

Embedded fonts output directory, may include custom variables. This is path relative to the Output directory.

For example, value “fonts” expands to “[Output directory]\fonts\”” path.

  {yyyy}{MM}{DD}{hh}{mm}{ss}{job05}{page03}

 

BMP

{HKLM, HKCU}\Software\REGISTRY_ENTRY\Converter\BMP
Option name Type Description Value Default value
Enabled REG_DWORD This option enables producing of BMP files. 0 – disable
1 – enable
0
Bits per pixel REG_DWORD This option sets color quality (bits per pixel) of BMP images. 1 – 1bpp (black and white)
4 – 4bpp color (16 colors)
8 – 8bpp color (256 colors)
24 – 24bpp
24
Grayscale REG_DWORD This option sets BMP to 8bpp grayscale mode. If enabled Bits per pixel parameter is ignored. 0 – grayscale mode off
1 – grayscale mode on
0
Dithering REG_DWORD Dithering algorithm to use for conversion of color images to 1-bit black&white images. The algorithms differ by speed and quality. 0 – Floyd-Steinberg
1 – Ordered-Dithering (4×4)
2 – Burkes
3 – Stucki
4 – Jarvis-Judice-Ninke
5 – Sierra
6 – Stevenson-Arce
7 – Bayer (4×4 ordered dithering)
0

 

PNG

{HKLM, HKCU}\Software\REGISTRY_ENTRY\Converter\PNG
Option name Type Description Value Default value
Enabled REG_DWORD This option enables producing of PNG files. 0 – disable
1 – enable
0
Bits per pixel REG_DWORD This option sets the color quality (bits per pixel) of PNG images. 1 – 1bpp (black and white)
4 – 4bpp color (16 colors)
8 – 8bpp color (256 colors)
24 – 24bpp
24
Grayscale REG_DWORD This option sets PNG to 8bpp grayscale mode. If enabled Bits per pixel parameter is ignored. 0 – grayscale mode off
1 – grayscale mode on
0
Dithering REG_DWORD Dithering algorithm to use for conversion of color images to 1-bit black&white images. The algorithms differ by speed and quality. 0 – Floyd-Steinberg
1 – Ordered-Dithering (4×4)
2 – Burkes
3 – Stucki
4 – Jarvis-Judice-Ninke
5 – Sierra
6 – Stevenson-Arce
7 – Bayer (4×4 ordered dithering)
0

 

JPEG

{HKLM, HKCU}\Software\REGISTRY_ENTRY\Converter\JPEG
Option name Type Description Value Default value
Enabled REG_DWORD This option enables producing of JPEG files. 0 – disable
1 – enable
0
Grayscale REG_DWORD This option sets JPEG to the grayscale mode. 0 – grayscale mode off
1 – grayscale mode on
0
Quality REG_DWORD This option sets the JPEG quality. Must be in range from 0 (min size) to 100 (max quality) 80

 

TIFF

{HKLM, HKCU}\Software\REGISTRY_ENTRY\Converter\TIFF
Option name Type Description Value Default value
Enabled REG_DWORD This option enables producing of TIFF files. 0 – disable
1 – enable
0
Bits per pixel REG_DWORD This option sets the color quality (bits per pixel) of TIFF images. 1 – 1bpp (black and white)
4 – 4bpp color (16 colors)
8 – 8bpp color (256 colors)
24 – 24bpp
24
Grayscale REG_DWORD This option sets TIFF to 8bpp grayscale mode. If enabled Bits per pixel parameter is ignored. 0 – grayscale mode off
1 – grayscale mode on
0
Dithering REG_DWORD Dithering algorithm to use for conversion of color images to 1-bit black&white images. The algorithms differ by speed and quality. 0 – Floyd-Steinberg
1 – Ordered-Dithering (4×4)
2 – Burkes
3 – Stucki
4 – Jarvis-Judice-Ninke
5 – Sierra
6 – Stevenson-Arce
7 – Bayer (4×4 ordered dithering)
0
Multipage REG_DWORD This option enables generation of multipage TIFF file. 0 – separate TIFF file for every printed page
1 – multipage TIFF file
1
Compression REG_DWORD This option sets TIFF compression. 0 – Automatic
1 – None
2 – CCITT modified Huffman RLE
3 – CCITT Group 3 fax encoding
4 – CCITT Group 4 fax encoding
5 – Lempel-Ziv & Welch
7 – JPEG DCT compression
8 – Adobe deflate compression
32773 – Macintosh RLE
32946 – Deflate compression
0

 

RAW

{HKLM, HKCU}\Software\REGISTRY_ENTRY\Converter\RAW
Option name Type Description Value Default value
Enabled REG_DWORD This option enables RAW-data storing after printing. 0 – disable
1 – enable
0

 

INI

{HKLM, HKCU}\Software\REGISTRY_ENTRY\Converter\INI
Option name Type Description Value Default value
Enabled REG_DWORD This option enables INI-file storing after printing. 0 – disable
1 – enable
0
Duplicate REG_DWORD Duplicate INI-file to the output directory for futher processing. 0 – do not duplicate
1 – duplicate
0

 

FTP

{HKLM, HKCU}\Software\REGISTRY_ENTRY\Converter\FTP
Option name Type Description Value Default value
Enabled REG_DWORD This option enables files upload via FTP/SFTP/FTPS. 0 – disable
1 – enable
0
Url REG_SZ URL string like «sftp://colorpilot.com».    
User Name REG_SZ User name.    
Password REG_SZ Plain-text password.    
Upload REG_SZ Information string for uploaded files. String value should be in format (TYPE:DIR;)*, where
TYPE: uploaded files type like EMF/BMP/JPEG/PDF/PNG/TXT/TIFF
DIR: target directory for upload. Upload directory should exist.

Sample:
in
«HKEY_CURRENT_USER\Software\Company\Printer\Converter\FTP»
Url=«sftp://colorpilot.com»
Upload=«BMP:.» will upload all BMP files to the «sftp://colorpilot.com/./» directory i.e. root directory.

Upload=«BMP:.;JPEG:jpeg;PNG:other/png» will upload all BMP files to the «sftp://colorpilot.com/./» directory, all JPEG files to the «sftp://colorpilot.com/jpeg/» directory and all PNG files to the «sftp://colorpilot.com/other/png/» directory.

   
Encrypted REG_DWORD Does user credentials encrypted with AES algorithm or not. 0 – not encrypted
1 – encrypted
0
Attempts REG_DWORD Count of attempts for files uploading to the FTP server.   1
Ignore certificate error REG_DWORD This option allows to ignore SSL certificate errors for FTPS/SFTP servers with self-signed certificates. 0 – do not ignore
1 – ignore
0

 

PDF

{HKLM, HKCU}\Software\REGISTRY_ENTRY\Converter\PDF
Option name Type Description Value Default value
Enabled REG_DWORD This option enables producing of PDF files. 0 – disable
1 – enable
0
Multipage REG_DWORD This option enables generation of a multipage PDF file. 0 – separate PDF file for every printed page
1 – multipage PDF file
1
Produce PDFA REG_DWORD This option enables producing of PDF-A/b files. 0 – disable
1 – enable
0
Timezone REG_DWORD This option allows to set timezone for file creation date . 0 – UTC time
1 – Local time
0
Grayscale REG_DWORD This option sets text and image color to 8bpp grayscale mode. 0 – grayscale mode off
1 – grayscale mode on
0
Subsetting REG_DWORD This option allows to reduce PDF size by creating a subset of a font. 0 – disable
1 – enable
1
Page Layout REG_DWORD This option allows to set document page layout. 0 – single page
1 – one column
2 – two column left
3 – two column right
4 – two page left
5 – two page right
0
Page Mode REG_DWORD This option allows to set document page mode. 0 – none
1 – outlines
2 – thumbnail
3 – full screen
4 – optional content
5 – attachments
0
Image Quality REG_DWORD This option allows to set image quality for PDF files. range value from 1 to 100 80
Black and White REG_DWORD Produce B&W non searchable PDF files. 0 – Searchable colored PDF
1 – Non searchable B&W PDF
0
Security Enabled REG_DWORD This option enables a password protection of PDF files. 0 – disable
1 – enable
0
Encryption Level REG_DWORD This option allows to set an encryption algorithm for document password. 0 – none
1 – 40-bit RC4
2 – 128-bit RC4
3 – 128-bit AES
4 – 256-bit AES
0
User Password Enabled REG_DWORD This option enables user password protection of PDFfiles. 0 – disable
1 – enable
0
User Password REG_SZ User password.    
Owner Password Enabled REG_DWORD This option enables owner password protection of PDF files. 0 – disable
1 – enable
0
Owner Password REG_SZ Owner password.    
Allow Copying REG_DWORD Allow copying or extraction a PDF document. 0 – do not allow
1 – allow
0
Allow Commenting REG_DWORD Allow form filling, signing or commenting a PDF document. 0 – do not allow
1 – allow
0
Allow Changing REG_DWORD Allow changing a PDF document. 0 – do not allow
1 – allow
0
Allow Printing REG_DWORD Allow printing a PDF document. 0 – do not allow
1 – allow
0
Title REG_SZ PDF document title.    
Author REG_SZ PDF document author.    
Producer REG_SZ PDF document producer.    
Creator REG_SZ PDF document creator.    
Subject REG_SZ PDF document subject.    
Keywords REG_SZ PDF document keywords.    

 

POS

{HKLM, HKCU}\Software\REGISTRY_ENTRY\Converter\POS
Option name Type Description Value Default value
Enabled REG_DWORD This option enables POS converter. 0 – disable
1 – enable
1
FontA REG_SZ Font A name.   Consolas
FontA Size REG_DWORD Font A size.   4
FontB REG_SZ Font B name.   Consolas
FontB Size REG_DWORD Font B size.   4
Encoding REG_SZ Default text character encoding in the receipt. Available values see at the end of the table. ASCII
Skip Header REG_DWORD Skip first N bytes from the beginning of a receipt.   0
Skip Less Than REG_DWORD Skip receipt which length in bytes less than specified value.   10
Specification REG_DWORD ESC/POS instructions set. 0 – common set
1 – EPSON set
2 – StarMicronics set
0
Left Margin REG_DWORD Specify default left margin in dots.   15
US-ASCII, ASCII, ISO646-US, ISO_646.IRV:1991, ISO-IR-6, ANSI_X3.4-1968, ANSI_X3.4-1986, CP367, IBM367, US, CSASCII, UTF-8, UCS-2, ISO-10646-UCS-2, CSUNICODE, UCS-2BE, UNICODEBIG, UNICODE-1-1, CSUNICODE11, UCS-2LE, UNICODELITTLE, UCS-4, ISO-10646-UCS-4, CSUCS4, UCS-4BE, UCS-4LE, UTF-16, UTF-16BE, UTF-16LE, UTF-32, UTF-32BE, UTF-32LE, UTF-7, UNICODE-1-1-UTF-7, CSUNICODE11UTF7, UCS-2-INTERNAL, UCS-2-SWAPPED, UCS-4-INTERNAL, UCS-4-SWAPPED, C99, JAVA, ISO-8859-1, ISO_8859-1:1987, ISO-IR-100, CP819, IBM819, LATIN1, L1, CSISOLATIN1, ISO8859-1, ISO-8859-2, ISO_8859-2:1987, ISO-IR-101, LATIN2, L2, CSISOLATIN2, ISO8859-2, ISO-8859-3, ISO_8859-3:1988, ISO-IR-109, LATIN3, L3, CSISOLATIN3, ISO8859-3, ISO-8859-4, ISO_8859-4:1988, ISO-IR-110, LATIN4, L4, CSISOLATIN4, ISO8859-4, ISO-8859-5, ISO_8859-5:1988, ISO-IR-144, CYRILLIC, CSISOLATINCYRILLIC, ISO8859-5, ISO-8859-6, ISO_8859-6:1987, ISO-IR-127, ECMA-114, ASMO-708, ARABIC, CSISOLATINARABIC, ISO8859-6, ISO-8859-7, ISO_88597:1987, ISO_8859-7:2003, ISO-IR-126, ECMA-118, ELOT_928, GREEK8, GREEK, CSISOLATINGREEK, ISO8859-7, ISO-8859-8, ISO_8859-8:1988, ISO-IR-138, HEBREW, CSISOLATINHEBREW, ISO8859-8, ISO-8859-9, ISO_8859-9:1989, ISO-IR-148, LATIN5, L5, CSISOLATIN5, ISO8859-9, ISO-8859-10, ISO_8859-10:1992, ISO-IR-157, LATIN6, L6, CSISOLATIN6, ISO8859-10, ISO-8859-11, ISO8859-11, ISO-8859-13, ISO-IR-179, LATIN7, L7, ISO8859-13, ISO-8859-14, ISO_8859-14:1998, ISO-IR-199, LATIN8, L8, ISO-CELTIC, ISO8859-14, ISO-8859-15, ISO_8859-15:1998, ISO-IR-203, LATIN-9, ISO8859-15, ISO-8859-16, ISO_8859-16:2001, ISO-IR-226, LATIN10, L10, ISO8859-16, KOI8-R, CSKOI8R, KOI8U, KOI8-RU, CP1250, WINDOWS-1250, MS-EE, CP1251, WINDOWS-1251, MS-CYRL, CP1252, WINDOWS-1252, MS-ANSI, CP1253, WINDOWS-1253, MS-GREEK, CP1254, WINDOWS-1254, MS-TURK, CP1255, WINDOWS-1255, MS-HEBR, CP1256, WINDOWS-1256, MS-ARAB, CP1257, WINDOWS-1257, WINBALTRIM, CP1258, WINDOWS-1258, CP850, IBM850, 850, CSPC850MULTILINGUAL, CP862, IBM862, 862, CSPC862LATINHEBREW, CP866, IBM866, 866, CSIBM866, CP1131, MACROMAN, MACINTOSH, MAC, CSMACINTOSH, MACCENTRALEUROPE, MACICELAND, MACCROATIAN, MACROMANIA, MACCYRILLIC, MACUKRAINE, MACGREEK, MACTURKISH, MACHEBREW, MACARABIC, MACTHAI, HP-ROMAN8, ROMAN8, R8, CSHPROMAN8, NEXTSTEP, ARMSCII-8, GEORGIAN-ACADEMY, GEORGIAN-PS, KOI8-T, PT154, PTCP154, CP154, CYRILLIC-ASIAN, CSPTCP154, RK1048, STRK1048-2002, KZ-1048, CSKZ1048, MULELAO-1, CP1133, IBM-CP1133, TIS-620, TIS620, TIS620-0, TIS620.2529-1, TIS620.2533-0, TIS620.2533-1, ISO-IR-166, CP874, WINDOWS-874, VISCII, VISCII1.1-1, CSVISCII, TCVN, TCVN-5712, TCVN5712-1, TCVN5712-1:1993, JIS_C6220-1969-RO, ISO646-JP, ISO-IR-14, JP, CSISO14JISC6220RO, JIS_X0201, JISX0201-1976, X0201, CSHALFWIDTHKATAKANA, JIS_X0208, JIS_X0208-1983, JIS_X0208-1990, JIS0208, X0208, ISO-IR-87, JIS_C6226-1983, CSISO87JISX0208, JIS_X0212, JIS_X0212.1990-0, JIS_X0212-1990, X0212, ISO-IR-159, CSISO159JISX02121990, GB_1988-80, ISO646-CN, ISO-IR-57, CN, CSISO57GB1988, GB_2312-80, ISO-IR-58, CSISO58GB231280, CHINESE, ISO-IR-165, CN-GB-ISOIR165, KSC_5601, KS_C_5601-1987, KS_C_5601-1989, ISO-IR-149, CSKSC56011987, KOREAN, EUC-JP, EUCJP, EXTENDED_UNIX_CODE_PACKED_FORMAT_F, CSEUCPKDFMTJAPANESE, SHIFT-JIS, SJIS, MS_KANJI, CSSHIFTJIS, CP932, ISO-2022-JP, CSISO2022JP, ISO-2022-JP-1, ISO-2022-JP-2, CSISO2022JP2, EUC-CN, EUCCN, GB2312, CN-GB, CSGB2312, GBK, CP936, MS936, WINDOWS-936, GB18030, ISO-2022-CN, CSISO2022CN, ISO-2022-CN-EXT, HZ, HZ-GB-2312, EUC-TW, EUCTW, CSEUCTW, BIG5, BIG-5, BIG-FIVE, BIGFIVE, CN-BIG5, CSBIG5, CP950, BIG5-HKSCS:1999, BIG5-HKSCS:2001, BIG5-HKSCS:2004, BIG5-HKSCS, BIG5HKSCS, BIG5HKSCS:2008, EUC-KR, EUCKR, CSEUCKR, CP949, UHC, JOHAB, CP1361, ISO-2022-KR, CSISO2022KR, CHAR, UTF-16LE, WCHAR_T, CP437, CP737, CP775, CP852, CP853, CP855, CP857, CP858, CP860, CP861, CP863, CP864, CP865, CP869, CP1125

 

Redirect

{HKLM, HKCU}\Software\REGISTRY_ENTRY\Converter\Redirect
Option name Type Description Value Default value
Enabled REG_DWORD This option enables the print redirection. 0 – disable
1 – enable
0
Force EMF REG_DWORD Force redirection in EMF format. 0 – Redirect in spool type format
1- Redirect EMF files
0
Printer REG_SZ Name of printer to redirect to.    
Redirect watermarks REG_DWORD This option enables watermarking on redirected documents. 0 – watermarks disabled
1 – watermarks enabled
0
Left Correction REG_DWORD Additional left margin in device units.   0
Top Correction REG_DWORD Additional top margin in device units.   0
Right Correction REG_DWORD Additional right margin.in device units.   0
Bottom Correction REG_DWORD Additional bottom margin in device units.   0
Scale Mode REG_DWORD Allows to scale source image to device’s margins. 0 – Actual size
1 – Fit
2 – Fit to width
3 – Custom
1
Horizontal Scale REG_DWORD Horizontal scale factor for Scale Mode == 3, in 1/100 units.   100
Vertical Scale REG_DWORD Vertical scale factor for Scale Mode == 3, in 1/100 units.   100
Extra Command REG_SZ

Extra command which will be send to the specified device at the end of the redirection. It should be a valid ESC/POS command which should contain text description of the command.

Allowed symbols are:

abcdefghijklmnopqrstuvwxyz
ABCDEFGHIJKLMNOPQRSTUVWXYZ
0123456789
!&+:?^}\'";@_~#(-<[`$).=\{%*/>]|

All escape symbols should be specified by it ASCII-name:

0x00 = "NUL", 0x01 = "SOH", 0x02 = "STX", 0x03 = "ETX",
0x04 = "EOT", 0x05 = "ENQ", 0x06 = "ACK", 0x07 = "BEL",
0x08 = "BS ", 0x09 = "HT ", 0x0A = "LF ", 0x0B = "VT ",
0x0C = "FF ", 0x0D = "CR ", 0x0E = "SO ", 0x0F = "SI ",
0x10 = "DLE", 0x11 = "DC1", 0x12 = "DC2", 0x13 = "DC3",
0x14 = "DC4", 0x15 = "NAK", 0x16 = "SYN", 0x17 = "ETB",
0x18 = "CAN", 0x19 = "EM ", 0x1A = "SUB", 0x1B = "ESC",
0x1C = "FS ", 0x1D = "GS ", 0x1E = "RS ", 0x1F = "US ",
0x20 = "SP ", 0x7F = "DEL"

All command data should be placed as HEX value with leading “0x”: “ESC p 0x00 0x3c 0xff”

   

 

Text

{HKLM, HKCU}\Software\REGISTRY_ENTRY\Converter\TEXT
Option name Type Description Value Default value
Enabled REG_DWORD This option enables producing of TXT files. 0 – disable
1 – enable
0
Multipage REG_DWORD This option enables generation of a multipage TXT file. 0 – separate TXT file for every printed page
1 – multipage TXT file
1
Encoding REG_DWORD This options sets text encoding. 0 – ANSI
1 – Unicode
2 – UTF-8
0
Write BOM REG_DWORD This option sets writing of byte-order mark (BOM) at the beginning of Unicode and UTF-8 encoded text file. 0 – BOM off
1 – BOM on
0
Line concatenation inteval REG_DWORD This option allows to set a width of an interval on axis OY in which two words are in a single line.   5
Word separation interval REG_DWORD This option allows to set a minimal separator width betwen two neighboring words.   1
Debug REG_DWORD This option allows to print tokens information at the end of text file. 0 – disable
1 – enable
0
Keep formatting REG_DWORD This option allows to keep an original document formatting. 0 – do not keep formatting
1 – keep formatting
1
Default Bidirectional Algorithm REG_DWORD This option allows to use default bidirectional algorithm. 0 – use inbuild BIDI algorithm
1 – use default BIDI algorithm
0

 

Watermarks

{HKLM, HKCU}\Software\REGISTRY_ENTRY\Converter\Watermarks
Option name Type Description Value Default value
Enabled REG_DWORD This option enables watermarks. 0 – watermarks disabled
1 – watermarks enabled
0
Quality REG_DWORD Image watermarks quality. range value from 1 to 100 100
General watermark settings are stored in the following registry key:
Converter\Watermarks\WatermarkID, where WateramarkID is a unique name of a watermark.
Type REG_DWORD Watermark type. 0 – image watermark
1 – textual watermark
 
Left offset REG_DWORD Offset from the left border in logical units.    
Right offset REG_DWORD Offset from the right border in logical units.    
Top offset REG_DWORD Offset from the top border in logical units.    
Bottom offset REG_DWORD Offset from the bottom border in logical units.    
Position mode REG_DWORD Position of an origin on a page. 0 – left-top corner of a page
1 – left-bottom corner of a page
2 – right-top corner of a page
3 – right-bottom corner of a page
4 – at the center of a page
 
Image watermark settings
Image path
(Image watermark only)
REG_SZ Full qualified path to an image watermark.    
Fill mode
(Image watermark only)
REG_DWORD Image position on a page. 0 – none
1 – fill
2 – fit
3 – stretch
4 – title
5 – center
 
Textual watermark settings
Text
(Textual watermark only)
REG_SZ Text watermark message, may include custom variables.    
Horizontal Alignment
(Textual watermark only)
REG_DWORD Text horizontal alignment on a page. 0 – left
1 – center
2 – right
 
Vertical Alignment
(Textual watermark only)
REG_DWORD Text vertical alignment on a page. 0 – top
1 – center
2 – bottom
 
Color
(Textual watermark only)
REG_DWORD Text color in 0xBBGGRR format, where
BB – blue channel
GG – green channel
RR – red channel
   
Font Name
(Textual watermark only)
REG_SZ Text font name.    
Font Height
(Textual watermark only)
REG_DWORD Text font height.    
Font Width
(Textual watermark only)
REG_DWORD Text font width.    
Rotation
(Textual watermark only)
REG_DWORD Text counterclockwise rotation angel in degreese.    

 

Installation Directory Settings

HKLM\Software\REGISTRY_ENTRY
Option name Type Description Value Default value
Installation Directory REG_SZ Full qualified path to the driver installation directory.    

 

Properties Dialog Settings

HKLM\Software\REGISTRY_ENTRY
Option name Type Description Value Default value
About: Hide page REG_DWORD Hide About property page. 0 – show
1 – hide
0
General: Hide page REG_DWORD Hide General property page. 0 – show
1 – hide
0
Paper: Hide page REG_DWORD Hide Paper property page. 0 – show
1 – hide
0
Additional: Hide page REG_DWORD Hide Additional property page. 0 – show
1 – hide
0
Application: Hide page REG_DWORD Hide Application property page. 0 – show
1 – hide
0
Converter: Hide page REG_DWORD Hide Converter property page. 0 – show
1 – hide
0
BMP: Hide page REG_DWORD Hide BMP property page. 0 – show
1 – hide
0
EMF: Hide page REG_DWORD Hide EMF property page. 0 – show
1 – hide
1
JPEG: Hide page REG_DWORD Hide JPEG property page. 0 – show
1 – hide
0
PDF: Hide page REG_DWORD Hide PDF property page. 0 – show
1 – hide
0
PNG: Hide page REG_DWORD Hide PNG property page. 0 – show
1 – hide
0
Redirect: Hide page REG_DWORD Hide Redirect property page. 0 – show
1 – hide
0
TIFF: Hide page REG_DWORD Hide TIFF property page. 0 – show
1 – hide
0
TXT: Hide page REG_DWORD Hide TXT property page. 0 – show
1 – hide
0
Version REG_SZ Product version info for About property page.    

 

For Developers

For developers we provide a full set of files and scripts for building their own installation package or incorporate Virtual Printer Driver to their products. We provide set of installation scripts for Wix Toolset and NSIS + Inno Setup. You will receive your a delivery package after purchase the Virtual Printer Driver. For tests we provide Devkit for our demo build of Virtual Printer Driver (x86 and x64 builds). Inside the Devkit you will find the next directories:

  • Files – files for VPD for x86 systems;
  • Files_x64 – files for VPD for x64 systems;
  • msi_installer – files for building MSI package with using Wix Toolset;

 

Binaries overview

Here is a short description of delivery package components.

files_full and files_full_x64 directories
Component name Description
pdfout.dll, emf2pdf.dll Our library that provide EMF to PDF conversion. If you do not required in the PDF format you can skip this file in your installation scripts.
fwproc.exe / fwproc_x64.exe Sends WM_COPYDATA notification to the target application.
Make.iss / Make_x64.iss Inno Setup installation scripts.
MessageBox.exe / MessageBox_x64.exe Shows standard Windows message box.
Microsoft_VC{120, 140}_CRT_{x86, x64}.msm Merge modules for Microsoft Visual C++ 2013, 2015 Redistributable Package. It uses in MSI package for installation required C-runtime libraries.
vcredist_{2013, 2015}_{x86, x64}.exe Microsoft Visual C++ 2013, 2015 Redistributable Packages. It uses in NSIS scripts for installation required C-runtime libraries.
printer.ico Icon file.
progress.exe Shows progress during the files convertation.
properties.exe Shows settings dialog for VPD.
README.pdf This file.
SampleClient.exe / SampleClient_x64.exe Sample client application that shows content of INI file after processing. You should use this sample as a start point of your application. Source code for this application available here:
setupdrv.exe Installs driver components of VPD.
SetupPrn.nsi / SetupPrn_x64.nsi NSIS installation scripts.
srvinst.exe / srvinst_x64.exe Installs VPDAgent service.
stdnames_7x{32, 64}.gpd${PREFIX}.gpd
${PREFIX}.ini
${PREFIX}pm.dll
${PREFIX}ui.dll
unidrv_7x{32, 64}.dll
unidrv_7x{32, 64}.hlp
unidrvui_7x{32, 64}.dll
unires_7x{32, 64}.dll
VPD components that allows to install VPD as a printer driver. ${PREFIX} is a custom file prefix, for example, for our demo build it equals to «tpdps».
${PREFIX}.lng Localization file for properties.exe tool. You can add or remove localization language here.
vpd_sdk.dll Our SDK that provides API for Virtual Printer Driver settings.
VPDAgent.exe / VPDAgent_x64.exe Windows service with name VPDAgent.
vpdisp.exe Converter tool for converting EMF files to raster or vector formats.

 

 

msi_installer directory
Component Description
VPDInstaller.sln Microsoft Visual Studio solution for building MSI package. Wix Toolset required.
License.rtf Our license file. You should replace it with your own or skip it.
make_msi_x86.bat / make_msi_x64.bat Batch files for building MSI package with using tools from Wix Toolset.
VPDInstaller.wixproj Microsoft Visual Studio project for MSI package. Wix Toolset required.
Config.wxi Configuration file for the MSI package. You should to modify it according to your requirements (company name, installation directory, default VPD settings, etc.)
RegistrySettings.wxs Configuration file for default registry settings. You should to modify it according to your requirements.
Product.wxs
ProductComponents.wxs
ProductTempComponents.wxs
Shortcuts.wxs
Other installation scripts.

 

Building MSI package

We provide sample scripts for building MSI package with using Wix Toolset. You should download and install Wix Toolset package. For this tutorial we use Wix v3.8 (Stable) version. Online documentation for Wix Toolet v3.* available here.

Before build you should to modify the RegistrySettings.wxs file to provide a valid settings for Application, Converter and Agent service components.

There are two ways of building MSI package:

  • with using Microsoft Visual Studio;
  • with using Wix tools.

 

Using Microsoft Visual Studio

Here is a short brief of building our sample with using Microsoft Visual Studio. The detailed documentation «Working in Visual Studio» availabe here.

Before starting you should install Wix Toolset and Wix Visual Studio Plugin. Open «msi_intaller/VPDInstaller» solution in your delivery package with using Microsoft Visual Studio. Specify target platform «x86» or «x64» in Solution Platforms and build Wix project via «Build → Build Solution». The result MSI package will placed to «msi_installer/VPDIntaller/bin» directory.

 

Using Wix tools

Here is short brief of building our sample with using Wix tools. The detailed documentation «Tools and concepts» available here.

Before starting you should install Wix Toolset. Open directory «msi_installer/VPDInstaller» in your delivery package. Here you will find two Batch files «make_msi_x86.bat» and «make_msi_x64.bat» which builds MSI package for x86 and x64 platforms respectively and place it to the «msi_intaller/VPDInstaller/bin» directory.

 

Building executable package

We provide sample scripts for building executable installation package with using NSIS and Inno Setup installers. For this tutorial we use NSIS v3.06.1 and Inno Setup 5.6.1(u) versions.

Before starting you should install NSIS and Inno Setup installers. For building installation package for x86 platform, you should use files and scripts from the «files_full» directory of your delivery package. For x64 platform you should use files and scripts from the «files_full_x64» directory. Later in the text we will refer to files from «files_full» directory. You can apply the same things to the files from the «files_full_x64» directory.

 

NSIS

Open «SetupPrn.nsi» in the favorite text editor and look at the two lines at the beginning of the file:

!define PRINTER_NAME “Your printer name”
!define PREFIX “Your file prefix”

Here you should change PRINTER_NAME and PREFIX defines to your specified.
PRINTER_NAME is a printer name which you have selected after purchace, for demo build you should set it to «Two Pilots Demo Printer»:

!define PRINTER_NAME “Two Pilots Demo Printer”

The next, you should set PREFIX to your file prefix. Look at the .gpd or .ini file in the «files_full» directory and place its name as PREFIX. For example, demo build has «tpdps.gpd» and «tpdps.ini» files, so, PREFIX should be «tpdps»:

!define PREFIX «tpdps»

Save changes and close «SetupPrn.nsi» file. Now, run «makensisw.exe» from the NSIS installation directory and select «SetupPrn.nsi» script from «File → Load script», NSIS will compile script. If all is correct you will receive «SetupPrn.exe» file in the «files_full» directory. Now you are ready to build Inno Setup script.

 

Inno Setup

Before starting you should build «SetupPrn.nsi» script. See previous section.

Open «Make.iss» with using Inno Setup Compiler («Compil32.exe» in the Inno Setup installation Directory) and look at the two lines at the beginning of the file:

#define PRINTER_NAME “Your printer name”
#define REGISTRY_KEY “Your registry key”

Here you should change PRINTER_NAME and REGISTRY_KEY defines to your specified.
PRINTER_NAME is a printer name which you have selected after purchace, for demo build you should set it to «Two Pilots Demo Printer». This is the same name as in the «SetupPrn.nsi» script.

#define PRINTER_NAME “Two Pilots Demo Printer”

REGISTRY_KEY is a registry key for storing VPD setting in the registry which you have selected after purchace, for demo build you should set it to «Two Pilots Demo Printer»:

#define REGISTRY_KEY “Two Pilots Demo Printer”

Modify the registry settings in the “[Registry]” section to provide a valid settings for Application, Converter and Agent service components.

Save changes and compile script «Build → Compile» in the «Inno Setup Compiler». If all is correct, you will receive «sample_installation.exe» in the «Output» directory. This file you can provide to your customers.

 

The Driver Pipeline

 

– Download Developer Manual as PDF –

 

Legal and Copyright Notices

Copyright © 2002-2023 Rais Garifullin and his licensors. All rights reserved. The Software is protected by international copyright treaties, as well as other intellectual property laws and treaties.

Portions of this product use the following libraries:

  • CxImage
  • LibJPEG
  • LibPNG
  • LibTIFF
  • zlib
  • libcurl
  • Crypto++
  • PDF Creator Pilot
  • libiconv
  • libidn

These libraries are redistributed under their own licenses. Read more…

 


Virtual Printer SDK:       Home       Download       Pricing       FAQ       Manual       Tutorials       Known issues       News