Configure printer-tray

Top Previous Topic Next Topic  Print this topic

In this example, we will use advanced Printing Options to print three copies of our 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.

 

The code for this example is listed below:

 

<?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 attributes have the following meaning:

 

The input-tray attribute specifies the index of the input tray that should be used. In our example, is 1.
The output-tray attribute specifies the index of the output tray that should be used. In our example, is "two".
The copy-count attribute specifies the number of copies that should be printed. Default is 1, in our example is 3.
The duplex attribute specifies whether this page sequence should be printed in duplex mode. Default is false, but in our example is true.
The media-color attribute specifies the color to use for printing. Default is none, in our example is blue.
The sheet-width and sheet-height options specify the dimensions of the sheet. In our example 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 for PostScript specific printer code to be inserted.