Jump to content

PDF PRINT

From Commander4j

The PDF_PRINT connector watches a folder for PDF files and prints each one on a named printer. It is a simple way to print reports or documents produced as PDF files by Commander4j or any other program, without anyone having to open them.

PDF_PRINT is used as a pair: a PDF_PRINT input with a PDF_PRINT output. No stylesheet is involved and the PDF is printed as it is.

Map configuration

config.xml

<map>
   <id>Map06</id>
   <enabled>true</enabled>
   <description>Print PDF Document</description>
   <enableEmailNotifications>true</enableEmailNotifications>
   <connectors>
      <input>
         <id>in1</id>
         <description>Read PDF Document</description>
         <type>PDF_PRINT</type>
         <url>
            <path>./interface/input/Map06 PDF to PRINT</path>
            <mask/>
            <prefix/>
            <pollingInterval>1000</pollingInterval>
         </url>
      </input>
      <output>
         <id>out1</id>
         <enabled>true</enabled>
         <description>Print PDF Document to HP8600</description>
         <type>PDF_PRINT</type>
         <url>
            <path>./interface/output/Map06 PDF to PRINT</path>
            <prefix/>
            <fileExtension/>
            <use83GUID>false</use83GUID>
            <retainOriginalFilename>false</retainOriginalFilename>
         </url>
         <print>
            <queueName>HP8600</queueName>
         </print>
      </output>
   </connectors>
</map>
Setting Description
type PDF_PRINT on both the input and the output.
input mask Leave empty to pick up files ending in .pdf.
output path A working folder. The PDF is held here while it is being printed.
print / queueName The name of the printer, as shown in the list of printers on the computer running Middleware4j. Upper and lower case do not matter. Leave the <print> section out to use the default printer.

Note that queueName must be inside a <print> element.

The settings shared by all connectors are described on the Maps page.

How it works

  1. The input connector finds a PDF file and saves a copy to the log folder.
  2. The output connector moves the file to the output folder.
  3. The file is sent to the printer.
  4. Once it has been sent, the file is deleted from the output folder.

Use cases

  • Printing Commander4j reports that have been saved as PDF to a folder.
  • Printing documents produced by another system without manual intervention.
  • Routing print jobs: other systems drop PDF files into different folders on a share, and a map for each folder sends them to the right printer.

Notes

  • If the printer name is not recognised, the error email sent to the Error list includes the names of all the printers that Middleware4j can see. Copy the correct name from that list into queueName.
  • The printer must be available to the account that Middleware4j runs under. A Windows service running as the Local System account usually cannot see network printers; run the service under an account that can. See Installation Middleware4j.

See also: Connectors, Maps, Installation Middleware4j