In this example, the advanced Printing Options will be used to print three copies of the document, printed in duplex mode, using blue as the color for printing. Sheet has a width of 8 inches and a height of 11 inches.
All the options will be added for the xf:printing-options element, that must be placed inside the fo:page-sequence tag, before any fo:flow elements.
Code sample:
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xf="http://www.ecrion.com/xf/1.0">
<fo:layout-master-set>
<fo:simple-page-master master-name="all-pages" page-height="2in" page-width="6in">
<fo:region-body region-name="xsl-region-body" column-gap="0.25in" padding="6pt" margin="0.7in" />
<fo:region-before region-name="xsl-region-before" display-align="after" extent="0.7in" padding="6pt"/>
<fo:region-after region-name="xsl-region-after" display-align="before" extent="0.7in" padding="6pt"/>
</fo:simple-page-master>
<fo:page-sequence-master master-name="default-sequence">
<fo:repeatable-page-master-reference master-reference="all-pages"/>
</fo:page-sequence-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="default-sequence">
<xf:printing-options input-tray="1" output-tray="two" copy-count="3" duplex="true" media-color="blue" sheet-width="8in" sheet-height="11in">
<xf:ps-printer-code/>
</xf:printing-options>
<fo:flow flow-name="xsl-region-body">
<fo:block>Hello World!</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>
The following attributes can be applied:
• | The input-tray attribute specifies the index of the input tray that will be used. In the example above, it is 1. |
• | The output-tray attribute specifies the index of the output tray that will be used. In the above example, it is two. |
• | The copy-count attribute specifies the number of copies that will be printed. The default value is 1 and in the example above it is set to 3. |
• | The duplex attribute specifies whether this page sequence must be printed in duplex mode. The default value is false. |
• | The media-color attribute specifies the color to use for printing. The default value is none. |
• | The sheet-width and sheet-height options specify the dimensions of the sheet. In the example above, sheet-width is 8 inches and sheet-height is 11 inches. |
The xf:ps-printer-code element can be added as a child of xf:printing-options and allows the user to insert PostScript specific printer code.
Identifying printer-trays names
Most of the time, the numbers associated with input trays (bins) are not 1, 2 etc. To identify these numbers, the printer PPD file must be checked.
However, the name of the input tray can be used instead of numbers. Usually, the names are "Automatically Select", "Manual Feed in Tray 1", "Tray 1", "Tray 2" etc. These also must be checked in the printer's PPD file, because the names depend on the printer.
The PPD file can be found on the CD included with the printer or on the manufacturer's website for printer documentation.
Also, XF Rendering Server registers the printer capabilities in the log file when a named tray is used.
It must look approximately like the following:
2380/8840-10:47:51 - TRACE:[The available input trays are:
2380/8840-10:47:51 - TRACE:' Automatically Select'->'15'
2380/8840-10:47:51 - TRACE:' Printer Auto Select'->'257'
2380/8840-10:47:51 - TRACE:' Manual Feed in Tray 1'->'258'
2380/8840-10:47:51 - TRACE:' Tray 1'->'259'
2380/8840-10:47:51 - TRACE:' Tray 2'->'260'
2380/8840-10:47:51 - TRACE:' Tray 3'->'261'
2380/8840-10:47:51 - TRACE:' Tray 4'->'262'
2380/8840-10:47:51 - TRACE:' Tray 5'->'263'
2380/8840-10:47:51 - TRACE:' Tray 6'->'264'
2380/8840-10:47:51 - TRACE:' Tray 7'->'265'
2380/8840-10:47:51 - TRACE:' Tray 8'->'266'
2380/8840-10:47:51 - TRACE:' Tray 9'->'267'
2380/8840-10:47:51 - TRACE:' Ex Tray (MP5)'->'268'
2380/8840-10:47:51 - TRACE:' Ex Tray (MP6)'->'269'
2380/8840-10:47:51 - TRACE:' Ex Tray (MP7)'->'270'
2380/8840-10:47:51 - TRACE:' Ex Tray (MP8)'->'271'
2380/8840-10:47:51 - TRACE:' Ex Tray (MP9)'->'272'
2380/8840-10:47:51 - TRACE:' Ex Tray (MP10)'->'273'
2380/8840-10:47:51 - TRACE:' Envelope Feeder'->'274'
2380/8840-10:47:51 - TRACE:'Unspecified'->'1256'
2380/8840-10:47:51 - TRACE:'Plain'->'1257'
2380/8840-10:47:51 - TRACE:'Preprinted'->'1258'
2380/8840-10:47:51 - TRACE:'Letterhead'->'1259'
2380/8840-10:47:51 - TRACE:'Transparency'->'1260'
2380/8840-10:47:51 - TRACE:'Prepunched'->'1261'
2380/8840-10:47:51 - TRACE:'Labels'->'1262'
2380/8840-10:47:51 - TRACE:'Bond'->'1263'
2380/8840-10:47:51 - TRACE:'Recycled'->'1264'
2380/8840-10:47:51 - TRACE:'Color'->'1265'
2380/8840-10:47:51 - TRACE:'Light <75 g/m2'->'1266'
2380/8840-10:47:51 - TRACE:'Heavy'->'1267'
2380/8840-10:47:51 - TRACE:'Cardstock >163 g/m2'->'1268'
2380/8840-10:47:51 - TRACE:'Glossy'->'1269'
2380/8840-10:47:51 - TRACE:'HP Heavy Glossy'->'1270'
2380/8840-10:47:51 - TRACE:'Tough paper'->'1271'
2380/8840-10:47:51 - TRACE:'Envelope'->'1272'
2380/8840-10:47:51 - TRACE:]