Printing PDF/Word Documents with ScriptX

This discussion assumes that you are familiar with the basic principles of controlling printing with ScriptX.

The Adobe Reader Add-in for Internet Explorer can be used to print PDF documents - for printing of multiple documents script will be required to manage a queue, load the documents and print them.

Alternatively, ScriptX printing provides the helper method BatchPrintPDF(url). This method performs the following steps:

  1. If necessary creates a background thread for processing.
  2. Adds the url to the queue of requests to be handled by the background thread. If required, the url is converted from a relative to absolute url.

The background thread:

  1. Takes the first item from queue and downloads it to the local temporary internet files folder (cache).
  2. Inspects the extension of the downloaded file:

Printing of Adobe Acrobat files

Using the Reader Add-in

The following sample is based upon the sample provided in the Adobe Acrobat 8.0 SDK. Use view source to examine how the code works.

Start Sample.

Using ScriptX

ScriptX does not implement printing of Acrobat files itself - it enlists the help of the Adobe Acrobat installed on the machine to perform the actual print. ScriptX uses the DDE (Dynamic Data Exchange) support provided by Acrobat Reader; ScriptX connects to a running instance of Acrobat Reader, or requests an instance to start and then sends the documented commands to print a document. Once a print is completed, Acrobat is asked to shutdown.

Start Sample.

On some systems, the loading of Acrobat to perform the printing may result in unacceptable screen 'flashing' as Acrobat is loaded and unloaded. A technique to reduce this is to load an Acrobat document so that Acrobat is already loaded - the loaded instance will be used to perform the print.

Start Sample.