OPALE - 10.0 - Utilisation - La commande MAP XPS/en

Différence entre versions

De MappingDoc
(Page créée avec « NUP (numerical value: 1, 2 or 4): merging 1, 2 or 4 pages of the initial document on 1 output page »)
Ligne 296 : Ligne 296 :
 
MEDIATYPE (alphabetical value): type of paper Examples: Archival, Label, Bristol, AutoSelect…
 
MEDIATYPE (alphabetical value): type of paper Examples: Archival, Label, Bristol, AutoSelect…
  
NUP (valeur numérique : 1, 2 ou 4) : regroupement de 1, 2 ou 4 pages du document initial sur 1 page en sortie
+
NUP (numerical value: 1, 2 or 4): merging 1, 2 or 4 pages of the initial document on 1 output page
  
 
LEFTOFFSET : marge de gauche en points
 
LEFTOFFSET : marge de gauche en points

Version du 12 juin 2019 à 14:10

Autres langues :
English • ‎français

Introduction

the MAP_XPS command is one of the main commands of OPALE Server. It allows you to process files for multiple final purposes.

The usal processing involves a file to map which is first generated in XPS format using the MAPCPYSPLF command, the MAP_XPS command is then used to edit this XPS file.

Xps-intro.PNG


To use the MAP_XPS command, run a CALL PGM(MAP_XPS) PARM ('-infile:/home/map2019/file.PDF' '-outfile:/home/map2019/file.xps' '-toXPS' '-fromPDF')

The MAPXPS command (without underscore) also exists. This one does not have as many applications and is mainly useful to convert files.

Converting files

Converting input files

Converting existing files to XPS is done to prepare them for future processing in the Mapping software.

The supported input languages are: AFP, ESCP, IGP, Image (BMP, JPG, PCX, PNG et TIFF), PCL, PDF, PS, SCS, TXT, Xerox, XPS, ZEBRA (ou ZPL), TEC


Examples:

map_xps -infile:/home/map2019/email.pcl -fromPCL -outfile:/home/map2019/email.xps -toXPS 
map_xps -infile:/home/map2019/email.pdf -fromPDF -outfile:/home/map2019/email.xps -toXPS 
map_xps -infile:/home/map2019/email.afp -fromAFP -outfile:/home/map2019/email.xps -toXPS 
map_xps -infile:/home/map2019/email.igp -fromIGP -outfile:/home/map2019/email.xps -toXPS 
map_xps -infile:/home/map2019/email.zpl -fromZPL -outfile:/home/map2019/email.xps -toXPS 
map_xps -infile:/home/map2019/email.ps -fromPS -outfile:/home/map2019/email.xps -toXPS  
map_xps -infile:/home/map2019/image.jpg -fromImage -outfile:/home/map2019/image.xps -toXPS -profile:fromJPEG

Such conversions can also be refined using a profile defined in the configuration file.

Mapxps entree.PNG

Converting XPS files to an output format

The aim is to convert XPS files (whether generated by Mapping or not) depending on their final purpose (printing, e-mail, archiving...) and communication channel.

The supported output formats are: AFP, BMP, DOCX, DPL, EPL, ESC, ESCP, HTML, IGP, JPG, Monarch, PCL, PDF, PNG, ProPrinter, PS, RTF, TEC, TIF, TXT, XMLDRAW, XPS, ZEBRA / ZPL.

Examples:

map_xps -infile:/home/map2019/email.xps -toPCL -outfile:/home/map2019/email.pcl 
map_xps -infile:/home/map2019/email.xps -toPDF -outfile:/home/map2019/email.pdf
MAP XPS.PNG


Such conversions can also be refined using a profile defined in the configuration file.

Example :

map_xps -infile:/home/map2019/email.xps -outfile:/home/map2019/email.pdf –convert –config:MYPDF
Mapxps-profil.PNG

Using parameters:

-config:XXXX or -profile:XXXX	=> to select the profile
-convert	=> converts the file using the selected profil

And a MYPDF profile defined in the configuration file:

<MYPDF>
<label>for Adobe Reader</label>
<language>PDF</language>
<embeddedfont>OFF</embeddedfont>
<color>ON</color>
</MYPDF>

To call a conversion profile as a command line, the language needs to be set to *AUTO on IBM i, and should not be "forced" on Unix or Windows (for instance, do not use arguments -profile:XXX and -toPCL simultaneously).


Note:

On IBM i, the XPSConfig.conf file is located in the home/mapping folder.

Specific parameters used for an AFPDS output

In addition to converting the file from XPS to AFPDS, you can force the resolution of fonts and images:

-fontRes:300: fonts resolution
-imageRes:300: images resolution 

Supported values: 240, 300 or 600 dpi.

Using profile parameters

All parameters mentioned and described here (input or output) can also be used as command lines. To use them as such, add the following to the map_xps conversion command: -param:name_of_the_parameter=value

Example:

map_xps -infile:/home/map2019/label.xps -outfile:/home/map2019/label.zpl -toZPL -param:resolution=203 -param:barcode=off

Managing indexing criteria

List all available indexes and their values

To list all indexing criteria in the file

Example:

map_xps -infile:/home/map2019/email.xps -dumpIndex
Mapxps-index.PNG


To list all index values in the file called indexing of a document


Example:

map_xps -infile:/home/map2019/email.xps –dumpIndex:CUSTOMER

Adding an index value on all pages of a document

In some cases, an indexing criteria can be present on all pages but some of them do not have index values, in other cases the indexing criteria is not present on all the pages. The following command is then used to reindex the document by copying the index values that are on the previous page onto the pages without index values.


Example:

map_xps -infile:/home/map2019/email.xps –copyEmptyIndex:INVOICE

A file before the command was run:

Page	Index	Value
1	INVOICE	1
2
 
3	INVOICE	2
4	INVOICE	3
5

File after the command was run:

Page	Index	Value
1	INVOICE	1
2	INVOICE	1
3	INVOICE	2
4	INVOICE	3
5	INVOICE	3

Adding indexing criteria to a document

The aim is to index a document by adding criteria to it.

The values of every criterion can be specified in the command line: all the pages of the document will then have the same index value.


Example:

 map_xps -infile:/home/map2019/email.xps -addCriteria:NUMORDER=123456


Mapxps-criteria.PNG


Index values usually come from a prior extraction of information in the document and are stocked in a temporary text file (as can be seen below). This syntax uses the keyword "File" to indicate that the added index values need to be extracted from the file created earlier.


Example:

map_xps -infile:/home/map2019/email.xps -addCriteria:NUMORDER=FILE:/home/map2019/email.txt [ –outfile:/home/map201/email_indexed.xps]

Extracting criteria values of a document

The aim is to look for information in the document to extract it and copy it in a temporary file so as to add it as indexing criteria of the same document afterwards. The temporary file created is in text format, in Unicode, with the following syntax: "value[TAB]page[CRLF]"

The information can be collected using keywords or locations.

The extra spaces before and/or after the text can be trimmed off so that the information returned does not include them. This is done using the following parameters:

-ltrim: deletes spaces before the text
-rtrim: deletes spaces after the text
-trim: deletes spaces before and after the text

Example 1: keyword research

map_xps -infile:/home/map2019/email.xps -extract:/home/map2019/email.txt
"-filter:Invoice for order" -length:10 –shift:2 -rtrim

10 characters are extracted, located 2 characters after the "Invoice for order" keyword, while the unwanted space after the returned text is deleted

Example 1: research per location

map_xps -infile:/home/map2019/email.xps -extract:/home/map2019/email.txt "-box:100,150,180,30,mm"

The parameters of the "box" specify its dimensions. The syntax is: xx.xx,xx.xx,xx.xx,xx.xx[,cm|in|mm]

4 decimal numbers, specifying respectively: top, bottom, left, right

The dot is the decimal delimiter

The comma or semi-colon is the values delimiter

The last parameter is the unite of these coordinates: in dots per inch (for a resolution of 96dpi) by default, in millimeters (mm),in centimeters (cm) or in inches (in)

Exporting indexes and their values

The aim is to create an index file from a document that would be archived in an other software later on. This index file can be in TXT, XML or IND (compatible with CMSs) format.

The "-duplicateindex" parameter also exports indexes with the same value on multiple pages.


Examples:

map_xps -infile:/home/map2019/mail.xps -indexfile:/home/map2019/file.txt –toXPS [-duplicateindex] 
map_xps -infile:/home/map2019/email.xps -indexfile:/home/map2019/file.xml -toXPS [-duplicateindex]  
map_xps -infile:/home/map2019/email.xps -indexfile:/home/map2019/file.ind -toXPS [-duplicateindex]
Mapxps-exportxml.PNG

Using indexing criteria

Sorting a document

The aim is to sort a document depending on the value of the indexing criteria. Only one output file will be created. The document is sorted by ascending order of numeric values by default. The ALPHA option allows you to sort with alphanumeric values and the REVERSE option allows you to sort by descending order.


Examples:

map_xps -infile:/home/map2019/email.xps -outfile:/home/map2019/email.pdf –sort:CUSTNBR -toPDF 
map_xps -infile:/home/map2019/email.xps -outfile:/home/map2019/email.pdf –sort:ALPHA:MAPSEND -toPDF
map_xps -infile:/home/map2019/email.xps -outfile:/home/map2019/email.pdf –sort:CUSTNBR,INV_NBR -toPDF 
map_xps -infile:/home/map2019/email.xps -outfile:/home/map2019/email.pdf -sort:CUSTNBR,REVERSE:INV_NBR -toPDF
Mapxps-trie.PNG

Spliting a document

The aim is to split a document depending on the values of indexing criteria. You can create as many output files as there are different criteria values.


Example:

map_xps -infile:/home/map2019/email.xps -outfile:/home/map2019/email_[[MAPSEND]].pdf –toPDF
Mapxps-eclater.PNG


The BUNDLEONINDEX creates bundles depending on the number of pages for every criteria value (for instance: 1 file with documents of 1 to 4 pages, 1 file with documents of 5 to 9 pages, 1 file with documents of more than 10 pages). You can create as many bundles as you would like to.


Example:

map_xps -infile:/home/map2019/email.xps -outfile:/home/map2019/email_[[BUNDDLEONINDEX,MAPSEND,1,5,10]].pdf –toPDF

In the BUNDLEONINDEX mode, the document can also be split depending on the number of the number of pages (that is to say whether the final page will be simplex/duplex or not), the the syntax is:

map_xps -infile:/home/map2019/email.xps -outfile:/home/map2019/email_[[BUNDDLEONINDEX=LEAF,MAPSEND,1,5,10]].pdf –toPDF

Filters based on criteria values

the aim is to put some pages apart of the rest of the document depending on the values of indexing criteria. This can be useful to create an input document which is only intended for specific customers.


Examples: map_xps -infile:/home/map2019/email.xps -outfile:/home/map2019/email.pdf -toPDF –filter:CUSTOMER=426 map_xps -infile:/home/map2019/email.xps -outfile:/home/map2019/email.pdf -toPDF "-filter:(CUSTOMER=4026) OR (CUSTOMER=1458) AND (PRICE=15)"

This can also be useful to run actions on specific pages only depending on criteria values (to manage PrintTickets for example)

Concatenating XPS files

The aim is to add several documents one after the other. The output document is the concatenation of all files specified in the command line, in the order they were placed.

You could then sort depending on indexing criteria which was defined beforehand in every file to merge files from different sources (invoice + standard form contract + newsletter…)


Examples:

Concatenating several XPS files in one go:

map_xps -outfile:/home/map2019/final.xps -add:/home/map2019/test1.xps -add:/home/map2019/test2.xps –add:/home/map2019/test3.xps

Concatenating several times when you do not already know the number of input XPS files:

 map_xps -tempfile:/home/map2019/final.xps -add:/home/map2019/test1.xps 
 map_xps -tempfile:/home/map2019/final.xps -add:/home/map2019/test2.xps 
 map_xps -tempfile:/home/map2019/final.xps -add:/home/map2019/test3.xps

Managing PrintTickets

The aim is to manage different parameters of a document printing job, either at job level or page level.

The syntax is:

map_xps -infile:/home/map2019/email.xps -set:NOM=VALEUR

The "-filter:XXX" option allows you to assign a printing attribute for some pages only, depending on the indexing values of the document.

the different "PrintTicket" attributes are:

DUPLEX: manages simplex/duplex

  • yes/no: double-sided using the long edges, or simplex only
  • long/short/F: doubled sided using the long or short edges, or simplex only

FRONTSIDE (on/off): forces the print to be on the simplex side (with PCL output only, combined with options -filter:XXX and -pages:*)

INPUTBIN / OUTPUTBIN (numerical value): managing input/output bins

  • ORIENTATION (numerical value)
  • 0: Portrait
  • 1: Landscape
  • 2: ReversePortrait 3: ReverseLandscape

COPY (numerical value): number of copies

STAPLE (numerical value)

  • 1 = SaddleStitch (staples in the middle of the page)
  • 2 = StapleBottomLeft (bottom left stapling)
  • 3 = StapleBottomRight (bottom right stapling)
  • 4 = StapleDualBottom (bottom stapling)
  • 5 = StapleDualLeft (left stapling)
  • 6 = StapleDualRight (right stapling)
  • 7 = StapleDualTop (top stapling)
  • 8 = StapleTopLeft (top left stapling)
  • 9 = StapleTopRight (top right stapling)
  • 10 = None (stop stapling)


MEDIATYPE (alphabetical value): type of paper Examples: Archival, Label, Bristol, AutoSelect…

NUP (numerical value: 1, 2 or 4): merging 1, 2 or 4 pages of the initial document on 1 output page

LEFTOFFSET : marge de gauche en points

TOPOFFSET : marge supérieure en points

JOBCUT : yes/no. Commande de rupture de job (pour utiliser le cutter sur les imprimantes possédant le dispositif)

TOGGLE : yes/no. Commande de décalage du papier.


Remarque :

Tous ces différents paramètres devront ensuite être gérés dans des profils de conversion du fichier XPSConfig.conf, en fonction de la destination finale des documents.Il est également possible d’utiliser ces paramètres lors d’une conversion directe sans passer par le -set : -duplex:LONG au lieu de -set:DUPLEX=LONG.


Exemples :

  • Pour paramétrer le recto/verso sur un fichier XPS existant :
 map_xps -infile:/home/map2019/myfile.xps -set:DUPLEX=yes
  • Pour paramétrer le recto uniquement sur un fichier XPS existant :
 map_xps -infile:/home/map2019/myfile.xps -set:DUPLEX=no
  • Pour gérer les PrintTickets au niveau page :
 map_xps -infile:/home/map2019/email.xps -set:INPUTBIN=2 -pages:2,3
  • Pour paramétrer le recto sur la première page et recto/verso sur les suivantes :
 map_xps -infile:/home/map2019/myfile.xps -set:DUPLEX=yes
 map_xps -infile:/home/map2019/myfile.xps -set:DUPLEX=no -pages:1

Envoyer un email

Principe : en sortie des traitements effectués par la commande map_xps, envoi direct du fichier résultant par email.

Paramètres obligatoires :

-toEmail | -toMail
-server:XXX => serveur SMTP
-from:XXX	=> expéditeur
-to:XXX	=> destinataire(s)
-infile:XXX => fichier XPS à joindre à l’email envoyé

Paramètres optionnels (le caractère optionnel ou non de certains arguments listés ci-après peut dépendre du serveur SMTP adressé) :

-domain:mydomain.net	=> domaine du serveur SMTP
-port:25	=> port du serveur SMTP
-login:username	=> identifiant de connexion au serveur SMTP
-passwd:*******	=> mot de passé de connexion au serveur SMTP
-cc:XXX	=> destinataire(s) en copie
-bcc:XXX	=> destinataire(s) en copie cachée
"-subject:This is my subject" => sujet du message
"-body:This is my body"	=> corps du message au format texte
-bodyhtml:XXX	=> corps du message au format HTML
-bodyhtml:FILE:/home/izaopale/bodyhtml.html
-footer:XXX	=> Pied de page du mail au format texte
-footerhtml:XXX	=> Pied de page du mail au format HTML
-footerhtml:FILE=/home/izaopale/footer.html
-attachment:XXX	=> ajout de pièce(s) jointe(s) supplémentaire(s), séparées par une virgule
-outfile:XXX	=> dans le cas de l’envoi d’email, cet argument sert à nommer la pièce jointe principale (argument infile) envoyée


Exemple 1 : map_xps -infile:/home/map2019/fichier.xps -toMail -from:XXX -to:XXX -login:XXX -passwd:XXX -server:XXX "-subject:Test envoi email" "-body:Ceci est un test" -outfile:nomPJ.xps


Exemple 2 : avec ajout de 2 pièces jointes map_xps -infile:/home/map2019/fichier.xps -toMail -from:XXX -to:XXX -login:XXX -passwd:XXX -server:XXX "-subject:Test envoi email" "-body:Ceci est un test" -outfile:nomPJ.xps -attachment:/home/izaopale/PJ1.pdf,/home/izaopale/PJ2.pdf


Exemple 3 : avec conversion en PDF de la pièce jointe map_xps -infile:/home/map2019/fichier.xps -toMail -from:XXX -to:XXX -login:XXX -passwd:XXX -server:XXX "-subject:Test envoi email" "-body:Ceci est un test" -toPDF -outfile:nomPJ.pdf

Maquettage avec sortie imprimée – Redirection dans une OUTQ

Maquettage du document et conversion implicite / explicite en sortie

Les langages de sortie supportés lors d’un MAPCPYSPLF sont les suivants : o Paramètre TYPLAN :

  • PCL
  • AFPDS
  • ZEBRA
  • DATAMAX
  • AUTO
  • IGP
  • TEC
  • IPL
  • F_D
  • PDF
  • EPL
  • XPS


La valeur spéciale *AUTO reprend la valeur du paramètre saisi dans l’option 1 du Menu Mapping.

Dans ce cas, si *AUTO est spécifié dans le paramètre TYPLAN de la commande, le logiciel utilisera les maquettes développées en langage PCL.

o Paramètre XPSCONVERT :

Valeur Remarque

  • AUTO Valeur du 14/14 - Paramètre PROFILE

Valeur de profil Celui spécifié dans le XPSConfig.conf


La valeur spéciale *AUTO permet de récupérer le nom de profil de l’imprimante qui est paramétré dans l’option Définition des paramètres imprimantes de Menu d’exploitation.


Exemple de définition:

Ici, pour toutes les imprimantes, le profil *PCL est spécifié. Ce qui permet par exemple, de ne pas avoir à spécifier le nom de toutes les Outq / Devices du système si les imprimantes physiques sont des Laser.

Ce nom de profil doit être paramétré dans le fichier XPSConfig.conf (situé dans l’IFS, sous la racine du répertoire MAPPING).

Un fichier de configuration par défaut est installé avec les valeurs suivantes :

<xpsconfig>

    1. This file contains the conversion profile for Mapping.
    2. You can create your own profile based on the Mapping documentation. BE CAREFUL WITH THE FILE STRUCTURE.
    3. PROFILE NAME STARTING WITH * ARE RESERVED FOR MAPPING. SO DO NOT CREATE OR MODIFY A PROFILE STARTING WITH *.
	<*XPS> 
	 	<label>DO NOT MODIFY - standard XPS</label> 
	 	<language>XPS</language> 
	</*XPS> 
	<*PCL> 
	 	<label>DO NOT MODIFY - standard PCL5/e</label> 
	 	<language>PCL</language> 
	 	<color>off</color> 
	</*PCL> 


Dans cet exemple, le profil *PCL utilise le langage PCL (paramètre <language> du profil.


Exemple de commandes pour sortie imprimée

Exemple de commande :

 MAPCPYSPLF SPLF(SPOOL) SPLNUM(7) JOB(QPADEV003K) JOBNUM(062592) USER(XXX) 
 MAPNAM(INVOICEXPS) MAPSEQ(00010) OUTQ(PCLPRT) TYPLAN(*XPS) XPSCONVERT(*AUTO) 

Explications:

TYPLAN : Pour positionner le langage de la maquette. Mais ce paramètre accepte aussi la valeur *AUTO : Auquel cas, le programme récupère la valeur positionnée dans le menu Mapping/Option 1.

XPSCONVERT : Conversion implicite réalisée en sortie. Ici, avec *AUTO le profil utilisé est celui qui est paramétré dans l’option 6 dans le menu Exploitation.


Autre exemple de commande :

MAPCPYSPLF SPLF(SPOOL) SPLNUM(7) JOB(QPADEV003K) JOBNUM(062592) USER(XXX) 
MAPNAM(INVOICEXPS) MAPSEQ(00010) OUTQ(PCLPRT) TYPLAN(*XPS) XPSCONVERT(*PCL) 

Explications :

XPSCONVERT : Conversion explicite réalisée en sortie. Ici, avec *PCL, c’est le profil *PCL du fichier XPSConfig.conf qui sera utilisé.

Maquettage avec sortie fichier dans l’IFS /Maquettage du document avec conversion et stockage dans l’IFS

Les mêmes commandes peuvent être utilisées afin de placer le résultat du maquettage et de la conversion dans un dossier de l’IFS. Il suffit pour cela de renseigner le paramètre XPSOUTFILE. En effet, la valeur par défaut de XPSOUTFILE est à *PRINT, pour ne pas générer de sortie fichier.

Exemple :

MAPCPYSPLF SPLF(SPOOL) SPLNUM(7) JOB(QPADEV003K) JOBNUM(062592) USER(XXX) 
MAPNAM(INVOICEXPS) MAPSEQ(00010) OUTQ(PCLPRT) TYPLAN(*XPS) XPSCONVERT(*PCL) XPSOUTFILE(‘/home/map2019/invoice.pcl’)

Rediriger la log dans un fichier

Principe : récupérer toutes les logs des commandes map_xps dans un fichier texte.

Exemple :

map_xps -infile:/home/map2019/email.xps –logfile:/tmp/mylog.log
Mapxps-log.PNG

Lister les ressources

Principe : affichage de toutes les ressources (polices et images) embarquées dans un fichier XPS.

Exemple :

map_xps -infile:/home/map2019/email.xps –listResource
Mapxps-listerR.PNG

Extraction de pages

Principe : définir des intervalles et/ou des sélections de pages à traiter. Les intervalles de pages sont à préciser sur la ligne de commande, les sélections peuvent être dans un fichier texte, où la syntaxe est : numéro de page+CRLF. L’utilisation du caractère ‘*’ est possible pour les intervalles de pages, pour choisir la fin du document.

Exemples :

map_xps -infile:/home/map2019/email.xps -outfile:/home/map2019/email.pdf -pages:1,3,4,7,10 –toPDF 
map_xps -infile:/home/map2019/email.xps -outfile:/home/map2019/email.pdf -pages:3-10 –toPDF 
map_xps -infile:/home/map2019/email.xps -outfile:/home/map2019/email.pdf -pages:1,5,10-* –toPDF 
map_xps -infile:/home/map2019/email.xps -outfile:/home/map2019/email.pdf -pages:FILE:/home/map2019/test.txt –toPDF

Extraction des données en XML (pour M-Designer)

Principe : créer un fichier XML compatible pour M-Designer, dans lequel toutes les données textes du fichier XPS sont extraites. Chaque zone de texte dans le fichier XPS devient un champ XML, nommé de manière unique par ses positions en X et Y. Les positions X et Y sont définies en 72 dpi.

Ce mode est aussi utilisé pour créer un fichier XML servant de base à l’ajout de codes OMR.


Exemple :

map_xps -infile:/home/map2019/billing.xps –toXMLDRAW -outfile:/home/map2019/billing.draw.xml
Mapxps-d-xml.PNG

Format et taille des pages d’un document :

Pour modifier la taille des pages du document, ou la taille des données à l’intérieur d’une page, il existe 3 arguments de la ligne de commande, ayant chacun leur fonctionnel : -paper:XXX : permet de changer la taille du papier (de la page), sans toucher au contenu. -scale:XXX : permet de changer la taille du contenu, sans toucher au papier. -changeformat:XXX : permet de changer le format du document, en modifiant la taille du papier tout en adaptant en contenu (avec conservation des proportions).

Syntaxes

Pour une mise à l’échelle du contenu d’une page, l’argument « -scale:XXX » prend des valeurs de pourcentage, de 0 à l'infini (attention aux pertes de données avec des valeurs supérieures à 100, puisque la taille du papier n’est pas modifiée).

Pour modifier la taille de la page en sortie, avec modification ou non du contenu, les arguments « - changeformat:XXX » et « -paper:XXX » permettent de définir la taille du format, soit à la norme ISO, soit en personnalisé.

Valeurs possibles ISO : AUTO, EXECUTIVE, LETTER, LEGAL, LEDGER, A4, A3, A2, A1, A0, MONARCH, COM10, DL, CS, B5 Syntaxe pour taille personnalisée : -changeformat:xx.xx,xx.xx[,cm|in|mm] 2 valeurs décimales correspondant respectivement à largeur et hauteur Le séparateur de décimale est le ‘.’ Le séparateur de valeurs est ‘,’ ou ‘;’

L’unité est optionnelle : cm (par défaut), mm ou in (pour inch) Exemples :

map_xps -infile:/home/map2019/billing.xps –scale:50 -outfile:/home/izaopale/out.xps 
map_xps -infile:/home/map2019/billing.xps –changeformat:A4 -outfile:/home/izaopale/out.xps
map_xps -infile:/home/map2019/billing.xps –changeformat:21,29.7,cm -outfile:/home/izaopale/out.xps

Rotation de documents

Principe : effectuer une rotation sur un fichier XPS

L’angle de rotation (en degré) est précisé sur la ligne de commande, 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.

D’où les valeurs supportées suivantes : -90 (rotation de 90° dans le sens horaire), 90, 180, 270. Notes : les valeurs -180 et -270 ne sont pas supportées (page blanche en sortie), il convient d’utiliser respectivement 180 et 90.

Mapxps-rotate.png

Exemple :

map_xps -infile:/home/map2019/fichier.xps -outfile:/home/map2019/fichier_90.xps –rotation:90 -toXPS

Fusion d’un fond de page sur un document existant

Principe : sur un document XPS existant, il est possible de venir rajouter un autre document en tant que fond de page, ou calque. Par exemple : ajouter un logo sur une facture existante n’en comportant pas.

De plus, l’argument optionnel « -mergemode:XXX » permet de contrôler plus finement la manière dont est rajouté ce calque.


Exemple : map_xps -infile:/home/map2019/billing.xps -merge:/home/map2019/logo.xps -mergemode:REPEATALL -outfile:/home/map2019/final.xps


Mapxps-fusion.png


L’argument « -merge:XXX » précise le nom du fichier à ajouter en tant que calque sur le document d’entrée. L’argument « -mergemode:XXX » précise la méthode d’ajout:

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 si rien n’est précisé.

Exemple :

  • En entrée : fichier d’entrée de 5 pages (identifiées par 1,2,3,4,5) et un calque de 2 pages (identifiées a,b)
  • En sortie : un fichier de 5 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.

Exemple :

  • Avec les mêmes entrées que précédemment, on aura en sortie un fichier de 5 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.

Exemple :

  • Avec les mêmes entrées que précédemment, on aura en sortie un fichier de 5 pages identifiées 1a,2b,3,4,5.

Variable d’environnement exportée

MAP_XPSFILE : contient le nom du fichier en cours d’extraction.


Gestion des input box

Le nom de la zone input text doit être « SUBMIT ».

-param:url=http://127.0.0.1:8002/cgi-bin/mapsoapserver.exe/mapRunPost?
map_xps -infile:/tmp/form_vide.xps -outfile:/tmp/test.pdf -toPDF
-param:url=http://127.0.0.1:8002/cgi-bin/mapsoapserver.exe/mapRunPost?
map_xps -infile:/tmp/form_vide.xps -outfile:/tmp/test.html -toHTML
-param:url=http://127.0.0.1:8002/cgi-bin/mapsoapserver.exe/mapRunPost?

Avec envoi d’e-mail :

map_xps -infile:/tmp/form_vide.xps -outfile:/tmp/test.html -toHTML -param:url=http://127.0.0.1:8002/cgi-bin/mapsoapserver.exe/mapRunPost? -toMail -from:exp@mydomain.net -to:dest@mydomain.net -subject:form -server:192.168.1.2 -domain:mydomain.net