PDF PRINT

From Commander4j

The PDF_PRINT connector monitors a directory for incoming PDF files and automatically sends them to a printer. It provides a simple way to automate printing of reports, labels, or documents that are generated as PDF files by Commander4j or any other application.

How It Works

When a PDF file appears in the monitored input directory, Middleware4j reads it using Apache PDFBox and sends it to the configured print queue. The file is then moved out of the input directory. No transformation is applied — the PDF is printed as-is.

Input Configuration

<input>
  <id>in1</id>
  <type>PDF_PRINT</type>
  <url>
    <path>./interface/input/Map06 PDF to PRINT</path>
    <mask/>
    <pollingInterval>1000</pollingInterval>
  </url>
</input>

Output Configuration

<output>
  <id>out1</id>
  <type>PDF_PRINT</type>
  <url>
    <path>./interface/output/Map06 PDF to PRINT</path>
  </url>
  <queueName>HP8600</queueName>
</output>

The queueName element specifies the name of the printer or print queue to use. This must match the printer name as it appears in the operating system's printer list. If queueName is omitted, the system default printer is used.

Use Cases

  • Automatically printing JasperReports output from Commander4j as PDF is delivered to the input folder
  • Printing documents generated by external systems without manual intervention
  • Centralising print routing — other systems drop PDFs to a network share monitored by Middleware4j, which routes them to the correct printer

Notes

  • The printer must be accessible from the machine running Middleware4j. For network printers, ensure the service account running Middleware4j has permission to access the print queue.
  • If Middleware4j is running as a Windows service under the System account, network printers may not be accessible. Configure the service to run under a domain account with the necessary permissions. See Installation Middleware4j.
  • No XSLT transformation is applied — the PDF is sent to the printer unchanged.

See also: Connectors, Maps, Installation Middleware4j