ONYX - 9.0 - Utilisation
Finishing option management (PrintTickets)
Sommaire
Introduction
We can see print tickets as printing options carried by a job intended to be printed. (Selection of input drawer, output drawer, double-sided, etc.)
This documentation deals with print tickets embedded in the XPS MAPPING file.
Operating principle
General
The XPS format was invented by Microsoft. Its first release dates from 2006. Mapping now uses (partially on its IBM-i OPALE version and completely on its Linux/Windows ONYX version) this format as a pivot format. In the case of XPS operation, the composition engine necessarily generates an XPS stream. Then MAPPING uses one of its converters to convert this XPS format into final streams (Zebra/TEC for label printing, PDF, PCL, etc.)
The principle is to position finishing information in the XPS document which will be taken up and translated by the conversions into the printing languages. The switch to use is -set:OPTION=value of the map_xps command. Options can be set globally (for the document) or at page level with either of the -pages:xxx (page selection) or -filter:xxx switches (page selection based on index values).
Different levels of the XPS file
The XPS format is a very structured format (unlike PDF for example) and also includes printing options (print tickets or finishing options). It is a compressed file (ZIP format). Its behavior structure 3 different levels:
- JOB level
- DOCUMENT level
- PAGE level
Each sub-level overloads its higher level.
Each of these levels can include print ticketing commands as well as other concepts. The /Metadata/Job_PT.xml file for the level in question contains the print ticket commands:
- Job level: /Metadata/Job_PT.xml
- Document level: /Documents/1/Metadata/Job_PT.xml (for the 1st document) or /Documents/2/Metadata/Job_PT.xml (for the 2nd document)
- Page level: /Documents/1/Pages/Metadata/Page1_PT.xml (for the 1st page of the 1st document) or /Documents/2/Pages/Metadata/Page10_PT.xml (for the 10th page of the 2nd document)
Example file Job_PT.xml or PageXX_PT.xml
Job level
The file containing print ticket information at job level is /Metadata/Job_PT.xml Mapping does not manage print tickets at the job level. Therefore, the content of this file remains the same for all XPS MAPPINGs. It is not possible to change it.
Here is its content:
<?xml version="1.0" encoding="UTF-16" standalone="yes"?> <psf:PrintTicket xmlns:psf="http://schemas.microsoft.com/windows/2003/08/printing/printschemaframework" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" version="1" xmlns:nsmappingsuite="http://www.mappingsuite.com/XMLSchema/2008/3/mappingsuitexpsdocumentwriter" xmlns:psk="http://schemas.microsoft.com/windows/2003/08/printing/printschemakeywords"> </psf:PrintTicket>
Document level
The file containing print ticket information at document level is /Documents/1/Metadata/Job_PT.xml' (for the 1st document)
Here is an example of content:
<?xml version="1.0" encoding="UTF-16" standalone="yes"?> <psf:PrintTicket xmlns:psf="http://schemas.microsoft.com/windows/2003/08/printing/printschemaframework" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" version="1" xmlns:nsmappingsuite="http://www.mappingsuite.com/XMLSchema/2008/3/mappingsuitexpsdocumentwriter" xmlns:psk="http://schemas.microsoft.com/windows/2003/08/printing/printschemakeywords"> <psf:Feature name="psk:PageMediaType"> <psf:Option name="psk:MEDIATYPE1"> </psf:Option> </psf:Feature> </psf:PrintTicket>
We can see that a print ticket command of mediatype which has the value MEDIATYPE1 has been inserted there.
<psf:Feature name="psk:PageMediaType"> <psf:Option name="psk:MEDIATYPE1"> </psf:Option>
In fact, the difference between the content of the file at job level (File not changed by print tickets) and this one is the insertion of these lines.
Example command to insert a medyatype command at document level:
IBM-i :
CALL PGM(MAP_XPS) PARM('-infile:/home/in.xps' '-set:MEDIATYPE=MEDIATYPE1' '-outfile:/home/out.xps')
Linux/Windows :
map_xps '-infile:/home/in.xps' '-set:MEDIATYPE=MEDIATYPE1' '-outfile:/home/out.xps'
Note: The absence of the -pages:X parameter in the map_xps command automatically positions its action (here the mediatype) at the document level and not at the page level
The different options that can be positioned in XPS are:
⇒ DUPLEX: front/back management
- Possible values:
- yes (or long) → front/back following the long edges
- shorts → front/back following the short edges
- no → front only
⇒ FRONTSIDE: forces the printing of a page on a front (used in PCL 5 output only, and must be positioned at page level, or in combination with the -filter:XXX and -pages:NN options)
- Possible values: yes / no
- Attention: for multi-document XPS, changing the document implies by default a return to the front, regardless of the "frontside" information on the first page of the document. To disable this operation in order to allow continuous R/V printing across all documents (i.e. without taking into account the concept of document), it is possible to add a parameter in XPSConfig.conf: <jobduplexalldocumentscontiguously>ON</jobduplexalldocumentscontiguously>
⇒ INPUTBIN / OUTPUTBIN: management of input and output bins
- Possible values: numerical value only
⇒ ORIENTATION: management of the orientation of the pages of the document
- Possible values:
- 0 Portrait
- 1 Landscape
- 2 Reverse portrait
- 3 Inverted landscape
⇒ COPY: number of copies (complete document or certain pages)
- Possible values: numerical value only
⇒ STAPLE: stapling management
- Possible values:
- 1 SaddleStitch (staple in the middle of the sheet)
- 2 StapleBottomLeft (bottom left stapling)
- 3 StapleBottomRight (bottom right stapling)
- 4 StapleDualBottom (staple at the bottom)
- 5 StapleDualLeft (left stapling)
- 6 StapleDualRight (right stapling)
- 7 StapleDualTop (staple on top)
- 8 StapleTopLeft (staple top left)
- 9 StapleTopRight (bottom right stapling)
- 10 None (to stop stapling)
⇒ MEDIATYPE: paper type management
- Possible values: alphanumeric value (examples: Archive, Label, Bristol, Preprinted, etc.)
⇒ NUP: grouping of 1, 2 or 4 pages of the initial document on 1 output page
- Possible values: 1, 2 or 4
⇒ LEFTOFFSET : gestion de la marge gauche
- Valeurs possibles: numérique, exprimée en points
⇒ TOPOFFSET : gestion de la marge haute
- Valeurs possibles : numérique, exprimée en points
⇒ JOBCUT : commande de rupture de job (pour utiliser le couteau sur les imprimantes équipées)
- Valeurs possibles : 0 ou 1
⇒ TOGGLE : commande de décalage du papier dans le bac de sortie des imprimantes
- Valeurs possibles : 0 ou 1
Remarque :
Les commutateurs suivants sont respectivement équivalents (sauf pour l’orientation) : -duplex:XXX, -frontside:XXX, -inputbin:NN, -outputbin:NN, -copy:NN, -staple:NN, -mediatype:XXX, -nup:NN, -leftoffset:NN, -topoffset:NN, -jobcut:NN, -toggle:NN.
Exemples :
⇒ Pour paramétrer le recto/verso sur un fichier XPS existant :
map_xps -infile:/tmp/myfile.xps -set:DUPLEX=yes -outfile:/tmp/myoutfile.xps
⇒ Pour paramétrer le recto uniquement sur un fichier XPS existant :
map_xps -infile:/tmp/myfile.xps -set:DUPLEX=no -outfile:/tmp/myoutfile.xps
⇒ Pour forcer l’impression de certaines pages sur un bac d’entrée particulier :
map_xps -infile:/tmp/myfile.xps -set:INPUTBIN=2 -pages:2,3 -outfile:/tmp/myoutfile.xps
⇒ Pour paramétrer le recto sur la première page et recto/verso sur les suivantes :
map_xps -infile:/tmp/myfile.xps -set:DUPLEX=yes -outfile:/tmp/tmpfile.xps
map_xps -infile:/tmp/tmpfile.xps -set:DUPLEX=no -pages:1 -outfile:/tmp/myoutfile.xps