ONYX - 9.0 - Utilisation - Traitements divers/en

Différence entre versions

De MappingDoc
(Page créée avec « Example : argument<code>-o:MA_DATE=20150219</code> de la commande <FONT color="blue"> map_lpr </FONT> »)
(Page créée avec « Example:<code>map_xps -infile:/tmp/invoice.xps -merge:/tmp/logo.xps -mergemode:REPEATALL -outfile:/tmp/invoice_final.xps</code> »)
 
(41 révisions intermédiaires par le même utilisateur non affichées)
Ligne 55 : Ligne 55 :
 
Example : argument<code>-o:MA_DATE=20150219</code> de la commande <FONT color="blue"> map_lpr </FONT>
 
Example : argument<code>-o:MA_DATE=20150219</code> de la commande <FONT color="blue"> map_lpr </FONT>
  
- Pendant les traitements de composition, elle est définie dans le Workflow d’exécution comme un paramètre et ainsi automatiquement gérée dans le moteur comme une variable d’environnement attachée au traitement :
+
 
 +
- During composition processing, it is defined in the execution workflow as a parameter and thus automatically managed in the engine as an environment variable attached to the processing:
  
  
Ligne 61 : Ligne 62 :
  
  
- Après composition, elle peut prendre la valeur d’un index positionné dans le document XPS préalablement exporté dans l’environnement par l’argument '''-environment'''.
 
  
Exemple : à l’issu de la composition, un document invoice.xps est obtenu contenant l’index MA_DATE. La commande suivante exporte les valeurs de l’index dans l’environnement puis utilise l’environnement pour remplacer dynamiquement le champ <nowiki>[[MA_DATE]]</nowiki> :
+
- After composition, it can take the value of an index positioned in the XPS document previously exported into the environment by the '''-environment''' argument.
  map_xps -infile:/tmp/invoice.xps -toPDF -outfile:/tmp/invoice.pdf -environment:MA_DATE -replaceEnv
+
 
 +
Example: at the end of the composition, an invoice.xps document is obtained containing the index MA_DATE. The following command exports the index values ​​into the environment and then uses the environment to dynamically replace the <nowiki>[[MY_DATE]]</nowiki> field:
 +
  map_xps -infile:/tmp/invoice.xps -toPDF -outfile:/tmp/invoice.pdf -environment:MY_DATE -replaceEnv
 +
 
 +
 
 +
 
 +
Noticed :
 +
All environment variables specific to the Windows or Linux system (DATE, TIME, COMPUTERNAME, etc.) and environment variables specific to ONYX Server (MAP_FILE, MAP_USER, MAP_TITLE, etc.) are natively accessible by this argument -replaceEnv.
 +
 
 +
 
 +
==Image conversion==
 +
 
 +
 
 +
When converting XPS documents to image, additional switches may occur for dimensions and color management:
 +
 
 +
 +
-sizeX:NN: specifies the desired width of the image, in pixels.
 +
-sizeY:NN: specifies the desired height of the image, in pixels.
  
  
Remarque :
+
When only one of these two parameters is entered, the dimensions of the output image are recalculated while maintaining the original proportions. When both parameters are specified then the original proportions are no longer taken into account and the image may possibly be distorted.
L’ensemble des variables d’environnement propres au système Windows ou Linux (DATE, TIME, COMPUTERNAME, etc.) et des variables d’environnement propres à ONYX Server (MAP_FILE, MAP_USER, MAP_TITLE, etc.) sont accessibles nativement par cet argument -replaceEnv.
 
  
==Conversion d'images==
+
 +
-bpp:NN: specifies the number of bits per pixel for color rendering.
  
Lors de la conversion de documents XPS en image, des commutateurs supplémentaires peuvent intervenir pour les dimensions et la gestion des couleurs :
 
  
-sizeX:NN : précise la largeur souhaitée de l’image, en pixels.
+
<u>Possible values</u>:
-sizeY:NN : précise la hauteur souhaitée de l’image, en pixels.
 
  
Lorsqu’un seul de ces deux paramètres est renseigné, les dimensions de l’image en sortie sont recalculées en conservant les proportions d’origine. Lorsque les deux paramètres sont renseignés alors les proportions d’origine ne sont plus prises en compte et l’image peut éventuellement être déformée.
 
  
-bpp:NN : précise le nombre de bits par pixels pour le rendu des couleurs.
+
1 bpp => two colors (so black and white)
  
<u>Valeurs possibles</u> :
 
  
1 bpp => deux couleurs (donc noir et blanc)
+
4 bpp => rendered in 16 colors
  
4 bpp => rendu en 16 couleurs
 
  
8 bpp => rendu en 256 couleurs
+
8 bpp => rendered in 256 colors
  
16 bpp => rendu en 65.536 couleurs
 
  
32 bpp => rendu en 16,6 millions de couleurs
+
16 bpp => rendered in 65,536 colors
  
==Format papier==
 
  
Trois commutateurs particuliers permettent de modifier les dimensions des pages d’un document XPS :
+
32 bpp => rendered in 16.6 million colors
  
<code>-paper:XXX </code>: permet de changer la taille du papier (de la page) sans toucher au contenu (attention aux potentielles pertes de données).
 
  
<code>-scale:NN </code> : permet de changer la taille du contenu sans toucher au papier.
+
==Paper format==
  
<code> -changeformat:XXX </code> : permet de changer le format du document en modifiant la taille du papier et en adaptant le contenu avec conservation des proportions.
 
  
Pour une mise à l’échelle (scale) du contenu des pages, la valeur est exprimée en pourcentage, de 1 à infini. La taille du papier n’étant pas impactée, il faut faire attention aux potentielles pertes de données avec des valeurs supérieures à 100. En combinaison d’une mise à l’échelle, le commutateur -center peut être utilisé pour centrer le résultat au milieu de page.
+
Three specific toggles allow you to change the page dimensions of an XPS document:
  
Pour modifier la taille des pages, avec adaptation ou non du contenu, les valeurs des commutateurs '''-changeformat''' et '''-paper''' expriment un format de papier soit à la norme ISO soit en personnalisé.
 
  
<u>Valeurs standards ISO possibles</u> : A2, A3, A3 Extra, A4, A4 Plus, A4 Extra, A5, A5 Extra, A6, B4, B5, B5 Extra, B6, Envelope #9, Envelope #10, Envelope #11, Envelope #12, Envelope #14, Envelope B4, Envelope B5, Envelope B6, Envelope C3, Envelope C4, Envelope C5, Envelope C6, Envelope C65, Envelope DL, Envelope Invite, Envelope Monarch, Envelope, Executive, Folio, German Legal Fanfold, German Std Fanfold, Japanese Postcard, Japanese Double Postcard, Ledger, Legal, Legal Extra, Letter, Letter Extra, Letter Plus, Letter Small, Note,PRC 16K, PRC 32K, PRC 32K(Big), PRC Envelope #1, PRC Envelope #2, PRC Envelope #3, PRC Envelope #4, PRC Envelope #5, PRC Envelope #6, PRC Envelope #7, PRC Envelope #8, PRC Envelope #9, PRC Envelope #10, Quarto, Statement, SuperA, SuperB, Tabloid, Tabloid Extra, US Std Fanfold.
+
<code>-paper:XXX </code>: allows you to change the size of the paper (of the page) without affecting the content (be careful of potential data loss).
  
<u>Syntaxe pour une taille personnalisée </u> : -changeformat:xx.xx,xx.xx[,cm|in|mm]
 
  
&rArr; deux valeurs décimales correspondant respectivement à largeur et hauteur
+
<code>-scale:NN </code>: allows you to change the size of the content without touching the paper.
  
&rArr; le séparateur de décimale est le ‘.
+
<code> -changeformat:XXX </code>: allows you to change the format of the document by modifying the size of the paper and adapting the content while preserving the proportions.
  
&rArr; le séparateur de valeurs est ‘,’ ou ‘;’
+
For scaling of page content, the value is expressed as a percentage, from 1 to infinity. As the paper size is not impacted, be careful of potential data loss with values ​​greater than 100. In combination with scaling, the -center switch can be used to center the result in the middle of page.
  
&rArr; l’unité est optionnelle : cm (par défaut), mm ou in (pour inch)
 
  
Exemples :
+
To modify the size of the pages, with or without adaptation of the content, the values ​​of the '''-changeformat''' and '''-paper''' switches express a paper format either to the ISO standard or to a custom one.
 +
 
 +
<u>Possible ISO standard values</u>: A2, A3, A3 Extra, A4, A4 Plus, A4 Extra, A5, A5 Extra, A6, B4, B5, B5 Extra, B6, Envelope #9, Envelope #10 , Envelope #11, Envelope #12, Envelope #14, Envelope B4, Envelope B5, Envelope B6, Envelope C3, Envelope C4, Envelope C5, Envelope C6, Envelope C65, Envelope DL, Envelope Invite, Envelope Monarch, Envelope, Executive, Folio, German Legal Fanfold, German Std Fanfold, Japanese Postcard, Japanese Double Postcard, Ledger, Legal, Legal Extra, Letter , Letter Extra, Letter Plus, Letter Small, Note,PRC 16K, PRC 32K, PRC 32K(Big), PRC Envelope #1, PRC Envelope #2, PRC Envelope #3, PRC Envelope #4, PRC Envelope #5, PRC Envelope #6, PRC Envelope #7, PRC Envelope #8, PRC Envelope #9, PRC Envelope #10, Quarto, Statement, SuperA, SuperB, Tabloid, Tabloid Extra, US Std Fanfold.
 +
 
 +
 
 +
<u>Syntax for custom size </u>: -changeformat:xx.xx,xx.xx[,cm|in|mm]
 +
 
 +
 
 +
&rArr; two decimal values ​​corresponding respectively to width and height
 +
 
 +
 
 +
&rArr; the decimal separator is ‘.’
 +
 
 +
 
 +
&rArr; the value separator is ‘,’ or ‘;’
 +
 
 +
 
 +
&rArr; the unit is optional: cm (default), mm or in (for inch)
 +
 
 +
Examples :
 
  map_xps -infile:/tmp/invoice.xps -scale:50 [-center] -outfile:/tmp/invoice_out.xps
 
  map_xps -infile:/tmp/invoice.xps -scale:50 [-center] -outfile:/tmp/invoice_out.xps
  
Ligne 127 : Ligne 151 :
  
 
==Rotation==
 
==Rotation==
Pour effectuer une rotation aux documents, le commutateur '''-rotation:NN''' est utilisé. L’angle de rotation est exprimé en degré sachant que le sens de rotation, par défaut, étant le sens trigonométrique (= anti-horaire). Sur le principe, tous les angles sont supportés mais seuls les angles droits respectent la cohérence des dimensions de la page d’origine ce qui engendre que les valeurs supportées sont les suivantes : -90 (rotation de 90° dans le sens horaire), 90, 180, 270.
+
To rotate documents, the '''-rotation:NN''' switch is used. The angle of rotation is expressed in degrees knowing that the direction of rotation, by default, being the trigonometric direction (= counterclockwise). In principle, all angles are supported but only right angles respect the consistency of the dimensions of the original page which means that the supported values ​​are as follows: -90 (rotation of 90° clockwise), 90 , 180, 270.
  
  
Remarque :
+
Note:
  
Les valeurs -180 et -270 ne sont pas supportées (page blanche en sortie), il convient alors d’utiliser respectivement 180 et 90.
 
  
 +
The values ​​-180 and -270 are not supported (blank page output), so 180 and 90 should be used respectively.
  
Exemple :
+
 
 +
Example :
 
  map_xps -infile:/tmp/invoice.xps -outfile:/tmp/invoice_90.xps -rotation:90
 
  map_xps -infile:/tmp/invoice.xps -outfile:/tmp/invoice_90.xps -rotation:90
  
==Fusion d'un fond de page sur un document existant==
+
==Merging a page background onto an existing document==
Le principe est que, sur un document XPS existant, il est possible de rajouter un autre document en tant que fond de page ou calque (exemple : ajouter un logo sur une facture existante n’en comportant pas).
+
The principle is that, on an existing XPS document, it is possible to add another document as a background or layer (example: add a logo to an existing invoice that does not include one).
Le commutateur utilisé est '''-merge:XXX''' dont la valeur est le nom complet du fichier XPS externe à ajouter comme calque.
+
The switch used is '''-merge:XXX''' whose value is the full name of the external XPS file to add as a layer.
L’argument optionnel '''-mergemode:XXX''' permet de piloter la manière dont est rajouté ce calque :
+
The optional argument '''-mergemode:XXX''' allows you to control the way in which this layer is added:
 +
 
 +
 +
- REPEATALL: all pages are merged by repeating the layer until the end of the input file. This is how it works
 +
by default.
 +
 
 +
Example:
 +
 
 +
 
 +
* Input => file of five pages (identified by 1, 2, 3, 4, 5) and a layer of two pages (identified by a, b)
 +
* Output => a file of five pages identified 1a, 2b, 3a, 4b, 5a
  
  - REPEATALL : toutes les pages sont fusionnées en répétant le calque jusqu’à la fin du fichier d’entrée. C’est le fonctionnement
+
   
par défaut.
+
- REPEATFULL: all pages are merged by repeating the layer as long as it can be inserted entirely.
  
Exemple :
 
  
* En entrée => fichier de cinq pages (identifiées par 1, 2, 3, 4, 5) et un calque de deux pages (identifiées par a, b)
+
Example: with the same entries as previously, the output file has five pages identified 1a, 2b, 3a, 4b, 5 (the last page is therefore not modified).
* En sortie => un fichier de cinq pages identifiées 1a, 2b, 3a, 4b, 5a
 
  
  - REPEATFULL : toutes les pages sont fusionnées en répétant le calque tant qu’il peut être inséré entièrement.
+
   
 +
-ONCE: the layer is only inserted once on the first page(s) of the input file.
  
Exemple : avec les mêmes entrées que précédemment, le fichier en sortie compte cinq pages identifiées 1a, 2b, 3a, 4b, 5 (la dernière page n’étant donc pas modifiée).
 
  
-ONCE : le calque n’est inséré qu’une seule fois sur la ou les premières pages du fichier d’entrée.
+
Example: with the same entries as previously, the output file has five pages identified 1a, 2b, 3, 4, 5.
  
Exemple : avec les mêmes entrées que précédemment, le fichier en sortie compte cinq pages identifiées 1a, 2b, 3, 4, 5.
 
  
Exemple :<code>map_xps -infile:/tmp/invoice.xps -merge:/tmp/logo.xps -mergemode:REPEATALL -outfile:/tmp/invoice_final.xps</code>
+
Example:<code>map_xps -infile:/tmp/invoice.xps -merge:/tmp/logo.xps -mergemode:REPEATALL -outfile:/tmp/invoice_final.xps</code>

Version actuelle datée du 3 janvier 2025 à 10:18

Autres langues :
English • ‎français

Log management

The -logfile:XXX switch allows you to redirect all messages from a map_xps command into a text file:

map_xps -infile:/tmp/invoice.xps -toPDF -outfile:/tmp/invoice_[[InvoiceID]].pdf -logfile:/var/logs/mylog.log


List of resources

The -listResource switch allows you to display on the screen (standard output) the resources (fonts and images) embedded in an XPS document:

map_xps -infile:/tmp/invoice.xps -listResource


Data extraction in XML

The principle is to create an M-Designer compatible XML file into which all the text data of the XPS document is exported. Each text box in the XPS file becomes an XML field uniquely named by its X and Y positions expressed in points for a resolution of 72 dpi.


Very little used as such, this XML output will find its interest in the additional calculations carried out for the addition of OMR codes.

Example:

map_xps -infile:/tmp/invoice.xps -toXMLDRAW -outfile:/tmp/result/invoice_data.xml


XML data extract:

<?xml version="1.0encoding="UTF-16standalone="yes?>
<doc>
<page name="NORMAL">
<field name="x289y112">Customer number: 10638</field>
<field name="x289y87">Invoice No. 10000 of 11/22/2008</field>
…
</page>
</doc>


Dynamic field replacement

The principle is to use dynamic replacement fields depending on the execution context in an XPS document. To do this, it is possible to define fields awaiting assignment in an XPS file. These fields will then be replaced with a value at run time.

For example, one use may be to print the edition date on a document but this date does not correspond to the exact moment of composition of the document but rather to that of sending the document to the destination printer. At the time of composition, in the M-Designer document model, you must then create a field awaiting replacement in the form [[MY_DATE]] (text box). Once the XPS document is composed, the value of this MA_DATE field will be dynamically replaced by the command line switch -replaceEnv. The replacement value will be found in the system environment. The whole challenge therefore consists of registering a MA_DATE variable in the environment and giving it a value.


Several ways to do this:


- Before composition, it is passed as a parameter by the application sending the data file to be composed in ONYX Server and will therefore be automatically managed in the engine as an environment variable attached to the processing.

Example : argument-o:MA_DATE=20150219 de la commande map_lpr


- During composition processing, it is defined in the execution workflow as a parameter and thus automatically managed in the engine as an environment variable attached to the processing:


OX S Dyn Champ.png


- After composition, it can take the value of an index positioned in the XPS document previously exported into the environment by the -environment argument.

Example: at the end of the composition, an invoice.xps document is obtained containing the index MA_DATE. The following command exports the index values ​​into the environment and then uses the environment to dynamically replace the [[MY_DATE]] field:

map_xps -infile:/tmp/invoice.xps -toPDF -outfile:/tmp/invoice.pdf -environment:MY_DATE -replaceEnv


Noticed : All environment variables specific to the Windows or Linux system (DATE, TIME, COMPUTERNAME, etc.) and environment variables specific to ONYX Server (MAP_FILE, MAP_USER, MAP_TITLE, etc.) are natively accessible by this argument -replaceEnv.


Image conversion

When converting XPS documents to image, additional switches may occur for dimensions and color management:


-sizeX:NN: specifies the desired width of the image, in pixels.

-sizeY:NN: specifies the desired height of the image, in pixels.


When only one of these two parameters is entered, the dimensions of the output image are recalculated while maintaining the original proportions. When both parameters are specified then the original proportions are no longer taken into account and the image may possibly be distorted.


-bpp:NN: specifies the number of bits per pixel for color rendering.


Possible values:


1 bpp => two colors (so black and white)


4 bpp => rendered in 16 colors


8 bpp => rendered in 256 colors


16 bpp => rendered in 65,536 colors


32 bpp => rendered in 16.6 million colors


Paper format

Three specific toggles allow you to change the page dimensions of an XPS document:


-paper:XXX : allows you to change the size of the paper (of the page) without affecting the content (be careful of potential data loss).


-scale:NN : allows you to change the size of the content without touching the paper.

-changeformat:XXX : allows you to change the format of the document by modifying the size of the paper and adapting the content while preserving the proportions.

For scaling of page content, the value is expressed as a percentage, from 1 to infinity. As the paper size is not impacted, be careful of potential data loss with values ​​greater than 100. In combination with scaling, the -center switch can be used to center the result in the middle of page.


To modify the size of the pages, with or without adaptation of the content, the values ​​of the -changeformat and -paper switches express a paper format either to the ISO standard or to a custom one.

Possible ISO standard values: A2, A3, A3 Extra, A4, A4 Plus, A4 Extra, A5, A5 Extra, A6, B4, B5, B5 Extra, B6, Envelope #9, Envelope #10 , Envelope #11, Envelope #12, Envelope #14, Envelope B4, Envelope B5, Envelope B6, Envelope C3, Envelope C4, Envelope C5, Envelope C6, Envelope C65, Envelope DL, Envelope Invite, Envelope Monarch, Envelope, Executive, Folio, German Legal Fanfold, German Std Fanfold, Japanese Postcard, Japanese Double Postcard, Ledger, Legal, Legal Extra, Letter , Letter Extra, Letter Plus, Letter Small, Note,PRC 16K, PRC 32K, PRC 32K(Big), PRC Envelope #1, PRC Envelope #2, PRC Envelope #3, PRC Envelope #4, PRC Envelope #5, PRC Envelope #6, PRC Envelope #7, PRC Envelope #8, PRC Envelope #9, PRC Envelope #10, Quarto, Statement, SuperA, SuperB, Tabloid, Tabloid Extra, US Std Fanfold.


Syntax for custom size : -changeformat:xx.xx,xx.xx[,cm|in|mm]


⇒ two decimal values ​​corresponding respectively to width and height


⇒ the decimal separator is ‘.’


⇒ the value separator is ‘,’ or ‘;’


⇒ the unit is optional: cm (default), mm or in (for inch)

Examples :

map_xps -infile:/tmp/invoice.xps -scale:50 [-center] -outfile:/tmp/invoice_out.xps
map_xps -infile:/tmp/invoice.xps -changeformat:A4 -outfile:/tmp/invoice_out.xps
map_xps -infile:/tmp/invoice.xps -changeformat:21,29.7,cm -outfile: :/tmp/invoice_out.xps

Rotation

To rotate documents, the -rotation:NN switch is used. The angle of rotation is expressed in degrees knowing that the direction of rotation, by default, being the trigonometric direction (= counterclockwise). In principle, all angles are supported but only right angles respect the consistency of the dimensions of the original page which means that the supported values ​​are as follows: -90 (rotation of 90° clockwise), 90 , 180, 270.


Note:


The values ​​-180 and -270 are not supported (blank page output), so 180 and 90 should be used respectively.


Example :

map_xps -infile:/tmp/invoice.xps -outfile:/tmp/invoice_90.xps -rotation:90

Merging a page background onto an existing document

The principle is that, on an existing XPS document, it is possible to add another document as a background or layer (example: add a logo to an existing invoice that does not include one). The switch used is -merge:XXX whose value is the full name of the external XPS file to add as a layer. The optional argument -mergemode:XXX allows you to control the way in which this layer is added:


- REPEATALL: all pages are merged by repeating the layer until the end of the input file. This is how it works

by default.

Example:


  • Input => file of five pages (identified by 1, 2, 3, 4, 5) and a layer of two pages (identified by a, b)
  • Output => a file of five pages identified 1a, 2b, 3a, 4b, 5a


- REPEATFULL: all pages are merged by repeating the layer as long as it can be inserted entirely.


Example: with the same entries as previously, the output file has five pages identified 1a, 2b, 3a, 4b, 5 (the last page is therefore not modified).


-ONCE: the layer is only inserted once on the first page(s) of the input file.


Example: with the same entries as previously, the output file has five pages identified 1a, 2b, 3, 4, 5.


Example:map_xps -infile:/tmp/invoice.xps -merge:/tmp/logo.xps -mergemode:REPEATALL -outfile:/tmp/invoice_final.xps