Best Practices for Printing

Use the PDFLPrintDoc interface when printing in Windows.

PDFLPrintDoc allows for either manual or automatic merging of printer capabilities when the print stream is generated, and it creates the stream most appropriate for the printer.

Note that some structure element names and default values may vary depending on the release of Adobe PDF Library. Check your own release header files to ensure that the element names and default values are correct. These typically appear in the header file PDFLPrint.h.

When printing, we recommend that you rely on the default settings in Adobe PDF Library as much as possible. Make as few changes as you can to the print settings.

In the PDFLPrintUserParamsRec:

  • size must be set
  • emitToFile should be false
  • printStm should be NULL
  • paperWidth and paperHeight should be left zero, unless you want to force a specific media size
  • DontEmitListLen should be set to zero, and dontEmitList set to NULL
  • emitToPrinter should be true
  • Ideally, inFileName will point to a string which identifies this file. This name will be used in separators to identify the actual paper.
  • outFileName should be left blank.
  • startPage and endPage must be set to the pages that you wish to print. Note that they are base zero.
  • shrinkToFit applies only if the page size does not match the paper size. In general, it is best to leave this off unless you know that your page is larger than the media, and that shrinking the page is permissible.
  • printAnnots is normally off. Most applications do not want to display interactive annotations on static paper.

In the PDFLPrintUserParamsRec, in the general case:

  • The value for psLevel should be the highest level of PostScript that your printer can interpret. It has meaning only when working with a PostScript printer. In Windows, you would set this in the printer setup dialog, based on the printer’s reported level. By default, set it to 2.
  • nCopies is the number of copies desired. By default it is 1. You can obtain a value for this from the printer.
  • binaryOK permits 8-bit data to be sent to the PostScript printer. If you know that you are in an environment where the printer and data channel to the printer support 8-bit data, this can safely be turned on. If you do not know, leave it off. Leaving this flag off will slow down print speeds.
  • turn on emitHalftones
  • set farEasFontOpt to PDPDFarEastFont_Download_All
  • turn off reverse
  • set transQuality to 1
  • set doOPP to false

If you want to keep your PostScript output file as small as possible, use these settings to limit the fonts downloaded to once per document:

  • optimizeForSpeed=true
  • saveVM=false

Setting useExecForm to True may be useful, in terms of reducing the file size, depending on the document content.
Also set emitRawData to False to reduce the size of the image streams.

When sending output directly to a file, if pages are not rotating properly, be sure to add this setting:
Setting setPageSize = true will insert the PostScript operator setpagedevice on each page into the PostScript output stream. Here is the setting for a legal-sized page:
/PageSize [6121008]