PEERNET
Overview

The information contained here is designed to aid developers in the use one of:

Please click through the tabs below and read the summary descriptions. Each tab describes one of the many ways to control the printers and details which versions of the printer the technique may be used. Not all printer versions support all techniques.

PNSrv9 COM Interface

PNSrv9 COM Interface was developed to manage the complex problem of handling and tracking print jobs.

You would use this interface if you were developing a conversion process in a programming environment that supports COM objects like C++, C#, VB and others.

This is not an interface used to change the settings of any of the printers. In fact, it creates its own printers for use during the conversion process as to not interfere with any existing printers and to allow many conversion to take place at the same time without interfering with each other.

If you were to develop your own printing solution, you would have to implement everything the COM interface does for you. Not that you could not do this, but we found from working with customers and their developers, that the work done by the COM interface required a detailed knowledge of the complex multi-threaded environment Microsoft uses to process a print job and this knowledge is hard to come by.

So to help you understand the power the PNSrv9 COM Interface, we have provided additional on-line information and samples.

Script File

The Script File is one of the simplest forms of controlling one of the PEERNET Printers. By default, each major release of a PEERNET Image Printer, since version 5, has a default Script File that it reads to override any settings specified in the printing preferences, document preferences or default preferences of the printer.

The script file can override some or all of the settings. The choose is yours.

The location of the script file is by default the user's TEMP folder, but you can specify a specific location by setting a key in the registry associated with the printer, named Scripting file.

Using a script file is NOT thread-safe unless you the developer take care to ensure it is.

The basic processing model is as follows:

  • Step 1: Create a script file assoicated with the target printer with the desired settings.
  • Step 2: Print the document to the target printer.
  • Step 3: Delete the script file once document has started spooling or started printing or process commands event has been signalled.
  • Step 4: go back to step 1 for next document.

Special care must be taken to ensure this process is thread-safe.

Master Script File

The Master Script File is a variation on the Script File technique.

By using a Master Script File, you are overriding the printing preferences, document preferences or default printing preferences of the printer for all documents sent to the printer.

You could use this method, if you needed the printer to be setup in a specific way that a user could not override. For example, you want the user to always create a monchrome 200 dpi output file or maybe you want a specific program to run at the end of each job.

By default, each major release of a PEERNET Image Printer, since version 5, has the ablity to specify a Master Script File that it reads to override any settings specified in the printing preferences, document preferences or default printing preferences of the printer or to specify that the Config File is the Master Script File.

The Master Script File can override some or all of the settings. The choose is yours.

The location of the Master Script File can be specified in:

  • a registry key associated with the printer, named Scripting file.
  • the Config File under the [Script File] section, and can specify a location or setup the Config File itself to be the Master Script File.

Using the registry key Scripting file allows each printer to have its own script file location. Using the Config File, means all printers based on the associated print driver will have the same script file.

rundll32 printui.dll,PrintUIEntry

The rundll32 printui.dll,PrintUIEntry is a command line utility provided by Microsoft as part of your operating system and is useful for a number of printer operations include adding printers, deleting printers, saving and restoring settings to name a few.

The command rundll32 printui.dll,PrintUIEntry /? displays the entire list of usage switches with extensive examples for using this method.

You can use this utility to help streamline your installations or help ensure settings, and other maintenance related activities.

Control Strings

Control Strings is a technique where specially formatted strings are embedded in documents in order to control the printing process.

They are most commonly used in report writers where you want to break up a report by using some key value like invoice number or account number.

This technique does not always work and is dependent on how the formatted string is sent to the print driver from the application. In versions prior to 8.x, any application that did not send the textual information using the standard TextOut or ExtTextOut as pure text strings would not work. In version 8.x and up, glyph index strings will work as well in most cases.

NOTE: If the application breaks up the prefix "~%0" used to mark the start of a Control String, the Control String will fail to function.


Copyright © 1997-2010. All rights reserved. Legal notice.
PEERNET® is a registered trademark of PEERNET Inc.

Friday, February 03, 2012