PDF PRINT: Difference between revisions

From Commander4j
Updated by push_wiki.py
 
Line 1: Line 1:
[[Category: Middleware4j]]
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.
=PDF_PRINT Map Configuration=
 
'''config.xml'''
== 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 ==
 
<syntaxhighlight lang="xml">
<syntaxhighlight lang="xml">
      <map>
<input>
        <id>Map06</id>
  <id>in1</id>
        <enabled>true</enabled>
  <type>PDF_PRINT</type>
        <description>Print PDF Document</description>
  <url>
        <enableEmailNotifications>true</enableEmailNotifications>
    <path>./interface/input/Map06 PDF to PRINT</path>
        <connectors>
    <mask/>
            <input>
    <pollingInterval>1000</pollingInterval>
              <id>in1</id>
  </url>
              <description>Read PDF Document</description>
</input>
              <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>
              </url>
            </output>
        </connectors>
      </map>
</syntaxhighlight>
</syntaxhighlight>


This Connector is designed to automatically print PDF files whenever they are found in the nominated directory.
== Output Configuration ==
You will notice that you can specify the name of a print queue in the element


<syntaxhighlight lang="xml">
<syntaxhighlight lang="xml">
<queueName>HP8600</queueName>
<output>
  <id>out1</id>
  <type>PDF_PRINT</type>
  <url>
    <path>./interface/output/Map06 PDF to PRINT</path>
  </url>
  <queueName>HP8600</queueName>
</output>
</syntaxhighlight>
</syntaxhighlight>
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 <code>queueName</code> 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]]
[[Category:Middleware4j]]

Latest revision as of 12:17, 1 April 2026

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