Sending output to a printer
This Quick Start describes how to use the Output service
to merge a form design with one or more records and send the output
to a printer.
Using the Output service, the records can be merged with a form
design to create filled forms that can be sent to a printer. The
form design must have corresponding field names for each field to
merge with the record. For example, when a purchase order process
completes at an organization, a record that contains the contents
of the purchase order is created and saved as an XML file. The contents of
the XML file are merged with a form design. Each record that is
merged with the form design creates a filled purchase order form.
The filled purchase order is sent to a printer named
a print server named
. (The printing environment
is configured by using Microsoft server networking.)
An application named
implements this service
for the organization. When a purchase order is completed, its contents
are saved as a record in an XML file named poData.xml. The poData.xml
file is sent at various time intervals to invoke the poProcessPrint
service. These assets are in the poPrintApp application:
A form design named PurchaseOrder.xdp that is used for
merging with the XML data.
A process named poPrintProcess that includes the following
that passes the XML data for purchases into
stores the merged PostScript® output.
A generatePrintedOutput operation (Output service), which
merges a form design with records in an XML file. The resulting
output is a
value that represents the
output for printing.
A sendToPrinter operation (Output service) that sends the
to a printer. You can choose from various printer protocols, depending
on how your printer settings are configured with the AEM forms Server.
The process diagram for the poPrintPrint process looks like the
The following XML file is generated from a purchase order request.
The XML file can have one or more records in it. To determine where
a record starts and begins, knowledge of which node or level the
record starts at is required. In the following XML file,
the first node (or root node) and is therefore at level 1. The batch
element contains three records. Each record is delimited by the
Therefore, in the following example, each record starts at level
<?xml version="1.0" encoding="UTF-8"?>
For the generatePrintedOutput operation, the following
properties are configured to generate PostScript output:
poPrintApp > poPrintApp/1.0 > purchaseOrder.xdp.
Use the Select Asset dialog box to specify the literal value.
inputXML variable. The inputXML variable
is an input
variable. The contents of
value are from the poData.xml file.
Generic Postscript Level 3 because PostScript
output is required. Depending on the print format, different default
device profiles (XDC files) are used. Because Generic Postscript
Level 3 is selected, the XDC URI property changes to ps_plain_level3.xdc.
XDC files are printer description files in XML format that describe
the capabilities of printers. You can modify XDC files. (See
Creating Device Profiles Using Workbench
The output generated by the operation.
Save to the variable outputPS, which is
the sendToPrinter operation, the following properties are configured
to send to a printer (Microsoft network) that the AEM forms Server
outputPS, which contains the PostScript output that was created
from the generatePrintedOutput operation.
SharedPrinter, because the printer
is connected to the AEM forms Server by using Microsoft server networking.
The printer protocol to use depends on how printers are configured
in the network.
\\myprintserver1, which is the name of
the print server.
\\printserver1\myprinter1, which is
the name of the printer. The complete name of the printer name must
include the printer server.
This Quick Start does not show you how to create the XML
that contains the collection of records or how to create a form
design that can be used with XML data. For information about creating
form designs, see
. For information about
creating XML data and considerations for creating form designs for the
Output service, see Designer Help.
The AEM forms Server must be configured to access the printer,
which requires you to set permissions on the application server.
For more information about the configuration settings required to
send output to print, see "Sending documents to printer" in the
Output Service chapter in
Services Reference for AEM forms
To use the generatePrintedOutput operation, these items must
be available to the process at run time:
An XML file that contains the records to merge with the
form design. An understanding of the XML structure is required in
order to set the record level.
An understanding of the type of output to generate. The type
of output to generate depends on the print formats that the printer
The printer protocol to use, the name of the print server,
and network name of the printer.