ONYX - 9.0 - Utilisation

M-Engine guide

De MappingDoc
Révision datée du 7 janvier 2025 à 14:19 par Jdieu (discussion | contributions) (Page créée avec « *Step 9: Generating a page break in each output file. And back to step 2. »)
(diff) ← Version précédente | Voir la version actuelle (diff) | Version suivante → (diff)

<language/>

Introduction

M-Engine is the new Mapping program. This program replaces map_xps and brings new features.A map_xps program still exists for backwards compatibility, but it uses M-Engine code.


Principle

The M-Engine works with a system of inputs and outputs. Inputs are command line arguments beginning with " -from”, outputs start with “-to”. Each argument can have several parameters (of type parameter=value) separated by the character ‘|’.


For example, converting an XPS file to PCL is done with the following command:

M-Engine.exe -fromXPS:fichier.xps –toPCL:fichier.pcl

If you want to call a conversion profile for PCL rendering:

M-Engine.exe -fromXPS:fichier.xps –toPCL:fichier.pcl|profile=PCL_Color


The file name is a parameter like any other, except that the parameter name is not necessary. But we could write the command like this: M-Engine.exe -fromXPS:file=file.xps –toPCL:file=file.pcl|profile=PCL_Color

Multiple inputs/outputs

The M-Engine command can accept several files as input and output, of different types. For example, converting a XPS file in PCL and PDF is done with the following command:

M-Engine.exe -fromXPS:fichier.xps –toPCL:fichier.pcl –toPDF:fichier.pdf


In the same way we can use several input files, these will be concatenated and/or merged according to the order of appearance in the command line:

Concatenating an XPS and a PDF:

M-Engine.exe -fromXPS:fichier.xps –fromPDF:fichier.pdf –toPCL:fichier.pcl

Using a PDF as a layer on an XPS:

M-Engine.exe -fromXPS:fichier.xps –fromPDF:fichier.pdf|merge=once –toPCL:fichier.pcl

The options can be combined, so you can concatenate several files and apply one or more layers to them before converting them. It is possible to work on all the files in a directory, thanks to the use of the ‘*’ character in the name of the input file. Concatenating all PDF files in a folder into a single PCL file:

M-Engine.exe -fromPDF:folder\*.pdf –toPCL:file.pcl

Command line arguments

Input files

  • -fromImage: or -fromIMG:

Allows you to add an image type input file (PNG, BMP, JPEG or TIFF) to the M-Engine.


  • -fromXPS:

Allows you to add an XPS type input file to the M-Engine.


  • -fromPDF:

Allows you to add a PDF input file to the M-Engine.


  • -fromPS:

Allows you to add a PostScript input file to the M-Engine.


  • -fromAFP:

Allows you to add an AFPDS type input file to the M-Engine.


  • -fromPCL:

Allows you to add a PCL type input file to the M-Engine.

  • -fromIGP:

Allows you to add a Printronix IGP type input file to the M-Engine.


  • -fromZPL:

Allows you to add a Zebra ZPLII type input file to the M-Engine.


  • -fromTEC:

Allows you to add a Toshiba TEC TPCL type input file to the M-Engine.


  • -fromESCP:

Allows you to add an ESC-P type input file to the M-Engine.

  • -fromTXT:

Allows you to add a TXT input file to the M-Engine.  

Output files

  • -to:

Allows you to add a typeless output file to the M-Engine. The file type must be defined in a conversion profile passed as a -to parameter.

For example: -to:c:\test\outfile.tmp|profile=profilename

The use of a conversion profile is mandatory with this command.  

Outputs for printing

  • -toPCL:

Allows you to add a PCL type output file to the M-Engine.


  • -toAFP:

Allows you to add an AFPDS type output file to the M-Engine.


  • -toESCP:

Allows you to add an ESC-P type output file to the M-Engine.


  • -toProPrinter:

Allows you to add a ProPrinter type output file to the M-Engine.


  • -toOPOS:

Allows you to add an OPos type output file to the M-Engine.


  • -toPrinter:

Allows you to add a printer output to the M-Engine. Example: M-Engine -fromXPS:infile.xps "-toPrinter:RICOH Aficio SP C830DN" Only works on Windows. The following name -toPrinter: must be the name of a printer defined on the Windows workstation.


Outputs for viewing and printing

  • -toXPS:

Allows you to add an XPS type output file to the M-Engine.


  • -toPDF:

Allows you to add a PDF output file to the M-Engine.


  • -toPS:

Allows you to add a PostScript output file to the M-Engine.


  • -toRTF:

Allows you to add an RTF output file to the M-Engine.


  • -toDOCX:

Allows you to add a Word Docx type output file to the M-Engine.

  • -toHTML:

Allows you to add an HTML output file to the M-Engine.  

Outputs for Thermal/BCP printing

  • -toDPL:

Allows you to add a Datamx DPL type output file to the M-Engine.

  • -toEPL:

Allows you to add an Eltron EPL type output file to the M-Engine.


  • -toIGP:

Allows you to add a Printronix IGP type output file to the M-Engine.

  • -toTEC:

Allows you to add a Toshiba TEC TPCL type output file to the M-Engine.


  • -toDB4:

Allows you to add a Toshiba TEC DB4 type output file to the M-Engine.

  • -toZPL: or -toZEBRA:

Allows you to add a Zebra ZPLII type output file to the M-Engine.


  • -toMonarch:

Allows you to add a Monarch type output file to the M-Engine.  

File outputs

  • -toIMG:

Allows you to add an Image type output file to the M-Engine, the image format will be chosen according to the file extension (.png, .jpeg, .bmp or .tiff).


  • -toTXT:

Allows you to add a TXT output file to the M-Engine.

  • -toXML:

Allows you to add an XML output file to the M-Engine. This format allows you to export the texts of a document in XML format. Example : <glyph y="64.960000" x="11.520000" line="11" col="4" >SHIP TO POSTAL CODE</glyph>

  • -toXMLPOS:

Allows you to add an XML pos output file to the M-Engine. This format allows you to export the texts of a document in XML format.

Example :

<TEXT VALUE="SHIP TO POSTAL CODE" ORIENTATION="0" POSX="24" POSY="135" SIZE="5" FONT="Courier New" BOLD="1" ITALIC="0"/>

  • -toIndex:

Allows you to add an index type output file to the M-Engine. The format can be xml or txt depending on the output file extension.


This output is used to export the metadata of a document.


  • -toMDesigner:

Allows you to add an M-Designer XML type output file to the M-Engine. The resulting xml file can then be imported into Designer to create a mock-up.

  • -toXMLDRAW:

Allows you to add an XML Mapping type output file to the M-Engine. An M-Designer mockup can then be applied to this XML to create a new XPS file.


Output for archiving

  • -toEverteam:

Allows you to add an output file for Everteam to the M-Engine.

  • -toEasyFolder:

Allows you to add an output file for EasyFolder to the M-Engine.


  • -toDigitech:

Allows you to add an output file for Digitech to the M-Engine.


  • -toOnBase:

Allows you to add an output file for OnBase to the M-Engine.


  • –toMStorage:

Allows you to add an output file for M-Storage to the M-Engine.


Global options

  • –replaceEnv

Enables the replacement of values ​​in square brackets (“[[variable]]”) with the contents of environment variables of the same name.


  • -addIndex:

Allows the addition of metadata to output files.


Syntax: -addIndex:metadataname=value Or -addIndex:metadataname=FILE:filepath


  • –indexOnAllPages:

Allows you to duplicate certain indexes on pages where they are not present.


Syntax: -indexOnAllPages:indexname1,indexname2,indexname3


  • -sort:

Specifies an index to use to sort file pages.


-sort:indexname1,indexname2,indexname3 Or -sort:indexname1 -sort:indexname2 -sort:indexname3


  • -filter:

Allows you to filter pages of input files based on metadata values. Mathematical (=, <, >, <=, >=) and logical (AND, OR) operators can be used for complex filters without forgetting priority parentheses.


  • -exec:

Allows the execution of any command line at the end of processing.


  • -onError:

Allows the execution of any command line at the end of processing if an error has occurred.

  • -onSuccess:

Allows the execution of any command line at the end of processing if no error has occurred.


  • –duplicateindex

Allows when exporting metadata (-toIndex for example) to take into account all occurrences of values.  

  • -set:

Adds or modifies printticket options.


Syntax: -set:option1=value1|option2=value2|option3=value3

Possible options:


  • filter

Allows you to filter the modification of the printticket based on the metadata of the page (syntax identical to -filter)


DUPLEX Allows you to choose double-sided printing, the possible values ​​are:

  • long
  • shorts
  • TwoSidedLongEdge
  • TwoSidedShortEdge
  • OneSided


  • INPUTBIN

Determines the input tray number to use. Expected numerical value.


  • OUTPUBIN

Determines the output bin number to use. Expected numerical value.


ORIENTATION Determines the orientation of the page, the expected values ​​are:

  • 0 -> Portrait
  • 1 -> Landscape
  • 2 -> Reverse portrait
  • 3 -> Inverted landscape
  • COPY

Determines the number of copies of each page. Expected numerical value.


  • TOP OFFSET

Determines the top offset of each page. Expected numerical value.

  • LEFTOFFSET

Determines the left offset of each page. Expected numerical value.


  • TOGGLE

Adds a job separator to the page. Expected boolean value (0, 1, ON, OFF, YES, NO).


  • MEDIATYPE

Sets the type of paper to use. Expected character string.


  • FRONTSIDE

Allows you to force printing on the front of the page. Regardless of the current duplex mode.

STAPLE Staple management. Possible values:

  • 1: SaddleStitch (stapling 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)
  • 16: None (to stop stapling) *In the documentation it is indicated 10, probably an error in the code


  • The documentation refers to the NUP and JOBCUT options, but these options are not currently present in v8

-lpr: Allows output files to be sent to a Mapping queue. The different parameters are separated by the character ‘|’. The possible parameters are:

  • title=title
  • tail=tail
  • user=user
  • priority=priority
  • nbcopy=nbcopy
  • retention
  • compress=compress
  • security=security
  • comptacode=comptacode
  • fidelity=fidelity
  • userdata=userdata
  • add
  • save
  • hold


Loaders and Renders settings

Each input file (loader) and each output file (render) can have a list of parameters. These parameters are separated by the character ‘|’ and follow the syntax “parameter=value”.

These parameters are all the possible options in the XpsConfig.xml file, for example the option to choose the resolution of an XpsConfig profile (<dpi>300</dpi> in the file) will be used on the command line in this way : “toPCL:filename.pcl|dpi=300”  

Concatenation and use of layers

Concatenation

There are several ways to concatenate files.

Using multiple loaders

Simply specify several input files to concatenate them. The concatenation will be done according to the order of appearance in the command line.

-fromXPS:fichier1.xps -fromXPS:fichier2.xps -toXPS:concat.xps


The input files can be in different languages, it is also possible to have several output files to perform concatenation in different languages ​​for example.


Directory Scan

The second method to concatenate files is to use the '*' character in the file name to allow multiple files to be read.

-fromXPS:*.xps -toXPS:concat.xps

Or

-fromXPS:prefixe* -toXPS:concat.xps


Layers

To use an input file as a layer it must have the “merge” parameter. The “merge” parameter can take several values:

  • repeatall

All pages are merged by repeating the layer until the end of the input files.


  • repeatfull

All pages are merged by repeating the layer as long as it can be inserted completely.


  • ounce

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


Order of treatments

  • Step 1:

Sorting the pages of the input files if necessary (presence of the -sort option for example).

  • Step 2:

Retrieving the page to process. Processing starts with the first page of the first input file, once all the pages of the file have been processed we move on to the next file. End of processing when there are no more pages to process.


  • Step 3:

Applying transformation options from the input file to the page (rotate, offset, resize)


  • Step 4:

Checking the filters. If the -filter option is present, the filter is applied to the page to determine whether it should be processed. Return to step 2 if the page does not match the filter.


  • Step 5:

Modification of the page's printtickets if the -set option is present.


  • Step 6:

Replacement of M-Designer variables such as “total number of pages”, “total number of documents”, etc…


  • Step 7:

Render layers in output files. (After applying transform options to the layer)


  • Step 8:

Applying transformation options from the output file to the page (rotate, offset, resize) And render the page into the output file. Step repeated for each output file.


  • Step 9:

Generating a page break in each output file. And back to step 2.