Components for Developers
© 2000-2018, Two Pilots

PDF Library   EMF2PDF SDK Pilot   Virtual Printers   HTML2PDF-X Pilot   Converters   PDF Mosaic  
Home Download Pricing FAQ Support Documentation Tutorials Languages Testimonials History

How to work with Virtual Printer using: C++ | C# | Delphi | VB.NET | VB 

Two Pilots Virtual Printer - Documentation (version 11.0)

- Download as PDF -

Table of Contents:

Overview
Getting Started
Virtual Printer for C#
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

 

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:

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:

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
{job05} Print job ID with leading zero
{page} Page number
{page03} Page number with leading zero
{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 ignore
1 - ignore
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:

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:

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 forEMF/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
    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
    Store embedded fonts REG_DWORD This option enables embedded font 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 (4x4)
    2 - Burkes
    3 - Stucki
    4 - Jarvis-Judice-Ninke
    5 - Sierra
    6 - Stevenson-Arce
    7 - Bayer (4x4 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 (4x4)
    2 - Burkes
    3 - Stucki
    4 - Jarvis-Judice-Ninke
    5 - Sierra
    6 - Stevenson-Arce
    7 - Bayer (4x4 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 (4x4)
    2 - Burkes
    3 - Stucki
    4 - Jarvis-Judice-Ninke
    5 - Sierra
    6 - Stevenson-Arce
    7 - Bayer (4x4 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. 0 - disable
    1 - enable
    0
    Url REG_SZ URL string like «ftp://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=«ftp://colorpilot.com»
    Upload=«BMP:.» will upload all BMP files to the «ftp://colorpilot.com/./» directory i.e. root directory.

    Upload=«BMP:.;JPEG:jpeg;PNG:other/png» will upload all BMP files to the «ftp://colorpilot.com/./» directory, all JPEG files to the «ftp://colorpilot.com/jpeg/» directory and all PNG files to the «ftp://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
    0
    FontA REG_SZ Font A name.   Liberation Mono
    FontA Size REG_DWORD Font A size.   48
    FontB REG_SZ Font B name.   Liberation Mono
    FontB Size REG_DWORD Font B size.   34
    Encoding REG_DWORD Specify text character encoding in the receipt. 0 - ASCII
    128 - Japanese Shift-Jis
    129 - Korean
    130 - Korean Johab
    134 - Chinese GB2312
    136 - Chinese Big5
    161 - Greek Windows-1253
    162 - Turkish Windows-1254
    163 - Vietnamese Windows-1258
    177 - Hebrew Windows-1255
    178 - Arabic Windows-1256
    186 - Baltic Windows-1257
    204 - Russian Windows-1251
    222 - Thai Windows-874
    238 - East Europe Windows-1252
    0
    Skip Header REG_DWORD Skip first N bytes from the beginning of a receipt.   0
    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

     

    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
    Type REG_DWORD Specify type of files to redirect. 0 - Redirect EMF file type
    1 - Redirect RAW file type (Spool)
    2 - Redirect POS file type
    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

     

    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
    Converter\Watermarks\WatermarkID, where WateramarkID is a unique name of a watermark.
    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
    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:

     

    Binaries overview

    Here is a short description of delivery package components.

    files_full and files_full_x64 directories
    Component name Description
    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:

     

    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 v2.46 and Inno Setup 5.5.4 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 Documentation as PDF -

     

  • How to work with Virtual Printer using: C++ | C# | Delphi | VB.NET | VB 

    Home Download Pricing FAQ Support Documentation Tutorials Languages Testimonials History

     

    PDF Library | EMF2PDF SDK Pilot | Virtual Printers
    HTML2PDF-X Pilot | Converters | PDF Mosaic

    Support | Blog
    Contact | About | Site map

    © 2000-2018, Two Pilots