M-Designer 8.0 Technical Reference Guide

De MappingDoc
Révision datée du 17 mars 2020 à 11:13 par Jdobbels (discussion | contributions) (Font)
(diff) ← Version précédente | Voir la version actuelle (diff) | Version suivante → (diff)

Sommaire

Introduction

Objectives

This document is the reference guide for the configuration and use of the M-Designer application, one of the modules of the Mapping Suite. We will introduce you to all the features of the application in this document.

This Guide applies to the M-designer software (version 8 and higher).

Presentation of M-Designer

M-Designer is the design and graphic composition module for documents. It is used to transform simple files of static data into high-quality graphic documents.

The software runs on Windows computers and has a user interface divided in two parts. The first part is a drawing type view for creating the page backgrounds (similar to pre-printed forms for printing) and the second is a dynamic view for retrieving, editing and presenting data. Whether it is directly from a spool or reformatted using the M-Connect software, the data comes from raw files (AS/400 spool type) and data extractions from databases or from ERP and are presented "flat" (text format) or in XML format (compatible with M-designer – see 6.3.XML mode: syntax and specifications).

The design of the model (document template) is performed on the user terminal that is hosting the application with a preview mode for validating the modifications as soon as they are made. During the design process, the document model is called an M-Designer project. The template is then generated and imported on the M-Processing Server (iSeries, Unix/Linux or Windows) to be used in production. We call this an M-Designer Format.

Installation

The install, update and uninstall procedures are set out in detail in the M-designer Installation and Update Guide.

Configuring M-Designer

After installing M-Designer, the first key step is to configure the Preferences (see 1) of the application. These can be opened in the File menu (see 2). These preferences are local to the current user and they are stored in the terminal's registry base under HKEY_CURRENT_USER/Software/Mapping.

General

The first tab of the Preferences window presents the general options of the application:

a.Automatic save This option is used to force an automatic backup of the projects that are currently in the design process (opened in the application) at regular intervals (defined in minutes in the corresponding input field).

b.Lock projects upon opening As will be referred to later in this guide, several users can work with M-Designer at the same time using a common directory for the projects. Within this context, it is strongly advisable to activate this option which prevents users from competing for access to the same project. As soon as a user opens a project, it locks the write access. Other users will only be able to consult a read-only version of the document.

c.Create .bak files When the user saves a project, this option is used to save a previous version of the project just prior to saving. The corresponding files are then given the .bak extension.

d.Select object before moving As will be referred to later in this guide, all the objects positioned in the document model can be modified and moved. This option forces the user to select an object before moving it with the mouse. This prevents accidentally moving objects when selecting them.

e.Enable script editor This option is used to create, modify, or delete one's own scripts (see Script printing link).

Note iSeries: This option is not available if the M-Processing Server is running on iSeries.

f.Show all component’s errors This option sets the number of error windows when opening a project containing components which are not or are no longer available in the project directory. - Enabled by default, a window for each unavailable component is displayed offering to find the component in question. - Disabled, the component errors are pooled and displayed in a single window. - g.Force straight lines This option forces the application to plot only horizontal or vertical lines (the most frequently used) by disabling the option for oblique lines.

h.Temporary folder This option defines the path of the temporary folder. By default, this is the folder for the installation of the application but this value can be changed if needed.

i.List of characters to be displayed in double width This input field is used to add the hexadecimal values (or ranges of values) with specific characters to be considered and displayed in double-width. This option is used on the M-Designer side to display the data stream in the Spool view and for the real-time preview of the model document. The equivalent exists on the M-Processing Server side for the execution, in the configuration variable MAPCPYSPLF_DBCSPITCH_list. j.Default Style This list is used to select or not select a style model for defining a specified list of colours, line type, fonts, etc. for your project.

k.Language This option is used to choose the display language of the interfaces of the application. The default language of M-designer will be the same as that of your operating system. The available languages are English, French and Japanese.

Changing the language display of M-designer will affect the other tools in the Suite, including M-Connect, and the application will have to be restarted for any change to be registered.

Configuring the servers

TheServers tab of the Preferences view is used to configure the paths the application must have access to:

  • the shared directory of the sources of the M-Designer projects
  • the directory(ies) for importing formats in the M-Processing Server

The shared directory of the sources contains all the projects developed by all the users of M-Designer. That folder should be a Network shared drive if more than one user develops templates.

Note iSeries: In an iSeries environment, the share folder points to the mapping path set in the MAPPING iSeries preferences (option 14 then 1 from the Mapping Main Menu on the iSeries)(see chapter 2.2.a).

Once developed, the M-Designer projects must be generated on the production server in the import directory.

Here are the default paths of the import directory of the M-Processing Server according to the type of platform:

  • Unix: ➔ /apps/mapping/import/
  • Windows: ➔ C:\Mapping\M-Processing Server\Import\
  • iSeries: ➔ /home/mapping/

In order to generate the project, a connection must therefore be established between the development terminals and the production server. Two types of configuration are possible.

a. Access to the server using a shared directory


Required settings:

1: Name given to the configuration.

2: Shared directory for the sources.

3: Access path to the import directory of the M-Processing Server.

The directory for accessing the server can be:

  • A UNC path

Examples: \\test_server\Mapping\M-Processing Server\Import\ (in Windows) \\Test_server \home\MAPPING\ (in iSeries)

  • A network drive pointing to the import directory

Example: either a network drive "M: " pointing to the " ...\M-Processing Server" folder of the production server. The access directory will therefore contain "M:\Import\".

b.Access to the server using an FTP connection In this case, an FTP (or SFTP) connection must be established between the development terminal and the production server.


Required settings:

1: Name given to the configuration. 2: Choice of the connection mode: FTP, Passive FTP, Secure FTP. 3: IP address of the production server. 4: User name for the FTP access. 5: Related password. 6: Shared directory for the sources. 7: Access path to the import directory of the M-Processing Server.

Font

In the Police tab, the Generation of XPS fonts by code page field is used to pre-load the XPS fonts by defining one or several code-pages in order to optimise the processing time during the process. The separation character used in the code-pages is " ; ". Note: When importing a project, if it is written with a non-registered font, an alert indicates that the font is missing and it will appear in red in the Properties of the affected Zone.

Calculation options

Both options present in the Calcul tab define the types of separators used for the thousands and the decimals. This information is used for recovering integer or real values in the application (by memory zones), the calculations made and the display of the results in the preview. They have no effect on the generation of projects.

Two equivalent variables exist for the execution on the M-Processing Server side: MAPCPYSPLF_THOUSAND and MAPCPYSPLF_DECIMAL. These settings are used globally for the server however they can be set differently before running any Mapping commands in order to apply others separators used in others countries.

Interface of the application

General presentation

When using M-Designer for the first time, only the Fixed Layoutdesign view is displayed. This simple display mode is used to subsequently activate the windows that you specifically require. Window activation is presented in Chapter 3.2.a File Menu.

The following image shows an overview of the user interface of M-Designer. It is worth noting in this example that the Spool File View, Properties, Conditions and Objects Tree windows have been activated.

It breaks down into several parts, as follows:

1: File menu.

2: Tabs of the Ribbon.

3: Groups of tools associated with each tab of the Ribbon.

4: Status bar with the tools for positioning and sizing the objects.

5: Navigation between the static part and the variable part of a project + display zoom tools.

Between the menus and tools displayed at the top of the window and the status bar located at the bottom is the Design Space where all the design work is done on the models. This design space can also be made up of several views, in addition to the central Design view:

6: View of the Properties: of the format, of an object selected in the template. 7: Spool File View: included here in the same display space as the Properties, which now has multiple tabs. 8: Objects Tree View: list of all the objects present in the model (static part and variable part). 9: View of Conditions: of the format, of a selected object.

The display positions in each view are entirely configurable according to the preferences and habits of each user. To do this, click (and hold) on the title of the view and then drag the mouse to the required display area or on a view that has already been positioned to obtain a display space with several views.

The related menus and toolbars

This chapter only presents the different menus and their options available in M-Designer's interface. Each notion will be developed and set out in detail in the following chapters. a.File menu


New:

  • Project: used to create a new project with the default properties (DEFAULT format, sequence 00010, page default size set to A4).
  • Component: used to create a new component with the default properties (page default size set to A4).
  • Variable Element: used to create a new variable element with the default properties (page default size set to A4).
  • Document: used to create a new Page Background (.mpw) or Dynamic (.mpi) document according to the selected view (Draw F or Map F). Overwrites the current document.

Open:

  • Project: used to open an existing project by browsing the folder structure of files. The directory highlighted by default depends on the Server preferences for the application.
  • Component: used to open an existing component.
  • Variable Element: used to open an existing variable element.
  • Document: used to open an existing Page Background (.mpw) or Dynamic (.mpi) document according to the view selected (Draw F or Map F). Overwrites the current document.
  • Spool: used to select a spool file for loading it into the application as a data model for the design.

Save:

  • Document: used to save an existing Overlay (.mpw) or Dynamic (.mpi) document, according to the project view displayed (Draw F or Map F).
  • Project: used to save the current project. The source files of the project will be saved by keeping, if needed, the previous versions in accordance with the user's preferences.

Save as:

  • Document: used to save the current project (.mpw or .mpi) under another name.
  • Project: used to save the current project under another name. The source files of the project will be saved under the new name(s) entered by the user.

Projects association:

  • Used to link several projects in order to facilitate their generation. Linking a project produces an *.mpa settings file on the disk, in which the projects concerned and the generation options are listed.

Multiple generation:

  • Used to select multiple M-Designer projects in order to generate them all in one go.

Import:

  • M-Designer File: in the static part of the current project, this is used to import another existing M-Designer page background such as a component or a static part of another project.
  • M-Designer XML: used to import into the application a complete M-Designer project which has previously been exported in XML format. This action imports the XML file as a new project, by recovering all of its properties and its design.
  • Resources: used to import into the application an external resource to be used as the page background of a new project. The resources can either be XPS documents or AFPDS page backgrounds.

Export:

  • Printer (PCL5): used to print the page background of the current project on a printer that has been acknowledged on the terminal.
  • Watermark (M-storage): used to export the page background of the current project as a layer that can be used in the M-Storage application.
  • Overlay (PCL5): used to select an M-Designer page background (.mpw) to be exported in PCL5 format to a disk.
  • Projects: used to select one or several projects to be exported to an archive (.zip) with any linked spools files.
  • M-Designer XML: used to export a current complete project in an XML description file. All of the properties and the design of the project are listed in the resulting file which can then be imported into another instance of the application on another terminal for example.

Close:

  • Used to close the current project or document and detect any changes that have not been saved.

Preferences:

  • See chapter 2.1 General.

b.Home Menu The Home menu opens the general options for the project or document currently being designed:

  • Clipboard:

Cut/copy/paste functions for one or more elements selected in the project (the standard keyboard shortcuts Ctrl+X, Ctrl+C and Ctrl+V are also available). Function to reproduce the formatting from one element in others (texts or styles). Function to duplicate a selected element and set the required number of horizontal and vertical occurrences (very useful for producing sheets of labels for example).

System fonts: Standard features for formatting texts: selection of the TTF system fonts (Windows) available on the user terminal, the size, the colour, the bold/underlined/italic options and the justification or alignments.

  • Generate:

Generation of the project in progress. This option is only available for a project currently undergoing the design process (open in the application). Generation of an existing project link. Function for exporting the overlay (see the File menu section). Access to the script utility available in the M-Designer application.

Preview:

  • Preview function of the projects currently undergoing the design process.
  • Button for selecting and loading a spool file in the application (useful for the design of the document and for the preview).
  • Multiple preview function for multi-sequence projects.
  • Option to save an image of the preview.
  • Option to load an XPS file as a layer (not included in the generation but displayed in the design like a pre-printed form).
  • Option to unlink the source file (spool) from the template and to close it.

c.Edit menu The Edit menu opens the design options for the current project or document:

In addition to the Clipboard and System fonts sections, covered in this menu, the following tools are also provided: Organize: For one or more selected items in the design view, there is the option to place them above or below the others and manage the alignments and rotations. These options are also available in the pop-up menu of the object(s) selected and will be addressed in detail in the following chapters.


Position according to grid: As an assistance during design work, a grid may be displayed for the user in order to facilitate the positioning of the elements. Both buttons in this section can be used to adjust the spacing of the grid (size of the grid pattern and therefore precision of the positioning) and activate the snap-to-grid function when moving objects.

d.Display menu The Display menu contains options for displaying different views of the application:

Show/Hide: Given that none of these options are activated when opening the software for the first time, those functions which are most suitable for the basic use of M-Designer will be marked with the term (recommended). Grid: used to display the grid in the design view.

Top/Left Ruler: used to display the top and left hand rulers of the design view. It is possible to place guides in these rulers in order to align objects more easily. By using Left click in the ruler you place and collapse a rule-guide. Using Right click on an existing rule-guide will delete it.

Spooled File View: used to display the loading view of the example spool file (or XML) (recommended).

Properties: used to display the properties view of the project and the elements (recommended).

Conditions: used to display the conditions view (recommended when the design work deals with a dynamic part).

Objects Tree: used to display the list of all the elements positioned in the document model with the option to access certain features related to each element.

Tab bar: used to display the tab navigation bar for the various projects open in the application.

Characters List: Contains a complete list of all the characters supported by the application according to a code page or a font page. Can be useful for inserting special characters in the document that cannot be entered directly using the keyboard.

Refresh: Used to refresh the screen.

Window: Small utility for working on different project windows which are open in the application with the option to activate one or the other but also to save or close one or more of the windows at the same time.

Shape menu

This last menu contains all the drawings and composition tools for the model document. Depending on the part of the project concerned by the design, namely, either the page background part (static) or the dynamic part (variable), this menu is set out differently.

Shape menu of the Overlay (or Static)

In addition to the Clipboard and System fonts sections, which are included in this menu, the following tools are proposed for the design work of the page background:

Insert: Add and position a zone containing static text with all the related formatting options. Add and position a static image (like a company logo for example). Add, set up and position a static table by defining the number of rows and columns, line styles and their formatting, row/column headers, etc.

Shapes: Standard drawing palette for adding lines, curves, squares, rectangles, rounded rectangles, circles, ellipses, as well as some complex preset shapes.

Styles: Formatting options related to each of the preceding elements: contour style and colour, fill style and colour, line thickness.

Generate: Specific option for designing a component that can be used to generate this component.

Shape menu of the Dynamic view

In addition to the Clipboard and System fonts sections, which are included in this menu, the following tools are provided for the dynamic design of the document:

Data: This group of tools includes the utilities needed to process the data of the source file (spool). It is composed of the following two types of tools:

GROUP: Used to add, configure and position the groups of data: fixed group and variable group. Also used to add anchors which are used for positioning the variable groups.

ZONE: Used to add, configure and position the data recovery zones.

Insert: Used to insert the following other dynamic elements, in addition to the data from the Spool File: straight lines, rectangles, text zones input using the keyboard, dynamic images, graphics… Also used to add components and/or variable elements which have been designed elsewhere in the project.

"Quick Access" toolbar

The title bar of the application finally provides a shortcut bar, or toolbar, called Quick access:

The tools and functions provided in this area are completely configurable based on the preferences of each user. In order to add a function to the quick access area, simply locate the function in question in the different menus and then right-click to select Ajouter à la barre d’outils Accès rapide as shown below: The new function then appears in the title bar:


To delete a function in the quick access area, simply click it using the right button and select Supprimer de la barre d’outils Accès rapide.

The drop-down menu to the right of the quick function area is used to personalise the available functions as well as their layout (display order, add separators) using the Personnaliser la barre d’outils Accès rapide option:

Creating a project

Project – Naming Conventions

An M-Designer Project is the association of a layout that combines a static part of the model and a data file, referred to as the variable or dynamic part. It is identified by a Format name and a

 Sequencenumber that makes it unique on the production server.

On a PC Drive or Network share, a project is made up of three files (or five files when it deals with duplex functionality):

  • An .mpw file that contains the front page background (another may contain the back page background if duplex mode involved)
  • An .mpi file contains the formatting of data on the front (there may be another one for the back side if duplex mode involved)
  • An .mppfile identifies the project and creates the link between the .mpw file(s) and the .mpi file(s) and a .pad file if this one has been loaded in the GUI.

This project concept is only worth it during the design of the model on the M-Designer side. Once generated on the production server, we then refer to it as format and sequence number.

Creating a project

To create a new project, go to the File menu > New > Project. The view of the design then displays the project in the form of a white page with the default settings (portrait, A4 in simplex mode). In the Display tab, it is advisable to tick Properties in the Show/Hide tab in order to display a window on the right-hand side of the screen with all the properties to be defined.

Start by entering the following two parameters (required):

  • Format name = identifier of the format (no more than 10 characters).
  • Sequence number = numeric identifier of the sequence (no more than 5 characters).

The notions of Format and Sequence will be set out in greater detail in the following paragraph. Other properties can be configured in this window:

  • Description = user information (limited to 25 characters maximum).
  • Comment = additional information.
  • Destination = path for generating the project (also defined in Preferences).
  • Mode = the type of data to be formatted: SPLF (text) or XML.
  • Code page = to open a non-Unicode spool file with XPS model specifying the file code page in the project properties. The option is available only SPLF mode.
  • Style = style sheet selection (also defined in Preferences). This option is detailed below.
  • Document and Page = allows you to embed data into printer language in the output stream for the following languages: PCL5, APFDS, PDF, ZPL, DPL, TEC, PGI, IPL and EPL. A zone can contain data for several different languages. When converting the XPS to the output language, the corresponding data to the output language will be used. The data is written at the beginning and end of the document.
  • Orientation = Portrait or Landscape for the front and, possibly, the back.
  • Page size (ISO standard formats or customised format) and margins.
  • Selection of a simplex or duplex project (with long-edge or short-edge binding).
  • Break page = default setting of the application that processes the data page by page and which activates a page break once the data of the current page has been processed. If this break is disabled, the data on the following page will be placed after the current page.
  • Batch Breaking = defines a Metadata type zone which will be used to group the pages of the final document in sequences (see paragraph 8.8.a. Pagination management by batch breaking)
  • Position = if the page break is disabled, this option can be used to specify the position of the data on the next page, i.e. to the right of the current page (horizontal shift) or below (vertical shift).

The SO/SI property is used in Windows and Unix to reproduce a native function under iSeries, i.e. the EBCDIC spool management containing both SBCS and DBCS characters (Asian and Japanese spools in particular). This property notifies the application about the detection mode and rendering of the Shift Out and Shift In information (non-printable 0x0F and 0x0E hexadecimal characters) that describes the DBCS texts in order to comply with the spacing between the characters regardless of their width.

In detail, the Style option allows both to limit the usable fonts in a template but also to rename these fonts using an alias. It allows for example to simplify the use of resident fonts in a template renaming TTF fonts installed on the computer by the name of the resident fonts of the type of target printer. The generated XPS file embeds the new name of the font defined in the style, it is possible to use these names for the definition of alternative fonts in the conversion profile.

Example of style used for printing on Datamax printer:

<?xml version="1.0" encoding="windows-1252" ?> <style> <fonts> </fonts> </style>

By default, M-Designer v8.0.2 comes with Datamax, Eltron, PGI, Intermec, TEC, and Zebra styles allowing the old non-Unicode reuse templates. The selection of these styles is automatic when opening an older template. The project is now ready to be developed. It is in XPS Unicode (Single use mode) by default.

Format / Sequence notion

A Format, managed using M-Processing Server, is the equivalent of an M-Designer project although it is generated and imported on the production server. The same format can be composed of several sequences. Each Sequence is conditioned to run on the different pages of a data file (spool or xml).

Here is an example that helps to understand the utility of having multiple sequences for the same project:

Namely a 3-pages invoice:

  • The first page contains the recipient's address, the sender's address as well as the beginning of the invoice table (Page type 1)
  • All the other pages contain the body of the invoice (Page type 2)
  • The last page contains the invoice total (Page type 2)

Treating this spool with the same format is difficult because the formatting options are different depending on the types of page. Three formats will therefore be created, one for each type of page. These three formats will have the same name because they all define THE "Invoice" document template but they will have a different sequence number:

  • Sequence 00010 that runs on the page type 1
  • Sequence 00020 that runs on the page type 2
  • Sequence 00030 that runs on the page type 3

During the execution of the invoice format on a data file, a MERGE of these three sequences will be conducted to process the spool completely.

Fixed layout (Draw Tab)

Definition

The Fixed layout includes all the fixed and static elements of an M-Designer project. An analogy may be made with the pre-printed elements in the printing sector. The design of the page background is done in the Draw F section, which can be opened by clicking the corresponding tab in the right-hand section of the status bar. Selecting this tab opens the Fixed layout toolbar in the Shapes ribbon. In case of a duplex project, the back also has its own page background that will be designed in the Draw B tab.

The elements of the fixed layout

a.Geometric shapes To draw one of these shapes, simply select the corresponding icon in the Shapes tab and then click (without releasing) the place where this element has to be positioned. Then give the element its required height and width by moving the mouse and then, finally, simply release the mouse button. Once drawn, a shape can be selected and dragged, and its properties (dimensions, shape and fill) can be edited. Preset of complex shapes can also be selected by clicking the Shapes icon:

Different types of filling of shapes are available from the properties of the object:

b.Texts

A text box can be inserted by selecting the Text icon and then clicking (without releasing) on the place where this box has to be positioned. As with a geometric shape, the mouse can be used to adjust the height and the width of the area. After releasing the mouse button, simply enter the text and then set the format (selection of the font, size, color, bold, alignment/justification, etc.)

c.Images Add an image by selecting the Image icon and then clicking (without releasing) on the place where this image has to be positioned. The required height and width can be set by moving the mouse.

After releasing the mouse button, a window appears asking you to select the Image file to be inserted. The selected image will be added to the page background of the project with the option to preserve/not preserve the proportions of the original file.

d.Static Table

This tool can be used to insert a so-called static table because its dimensions and properties will be defined as soon as it is created by the user. Add the table by selecting the Static table icon and then clicking (without releasing) on the place where this image has to be positioned. After releasing the mouse button, a window appears asking you to define different settings for the rows and columns such as the size, position, number, colour, titles, etc. Another way to design a table, without defining its dimensions, is by using the alternative method set out in greater detail in paragraph 8.5. Draw a table.

Dynamic Part (Map Tab)

Definition

The Map section of a project refers to the dynamic part of the template that depends on each stream of data processed by this model. The main elements, which can be placed in this section are, first of all, the printable information of the data files. Selecting the Map F tab (MAP B for the back of the document) brings up the interface related to the placement of these elements. In this design view, the elements of the Draw section appear in the form of a watermark – they are greyed and can’t be selected - to facilitate the positioning of print data.

"Spooled File" notion

In order to locate and identify the print data, the design of an M-Designer project is based on a sample file. This sample file is the image of the production spool to be formatted. Two types of data file are natively supported in M-Designer: paginated text files and XML files in the Mapping format. The configuration of the type of input file is done in the properties of the project.

Files processed by M-Designer can have .PAG or .TXT extension. Historically, the text files have the .PAG extension because they are paginated. A non-paged file can be paged through the MAPPAGIFS command from M-Processing Server where an argument specifying the number of lines per page ("Overflow") will be particularly specified. The XML files must comply with a preset syntax so that they can be properly used in the application (see 6.3 XML mode: syntax and specifications).

In order to open and display a sample file in M-Designer, the spool view must be enabled in the Display menu:

To load the spool file in the application, go to the Home tab and simply click and select the file to be loaded. The Spool view then displays the data to be formatted:

In order to assist the user in designing the project, a preview is available for viewing the result without having to print the document. To do this, simply click the Preview button in the Home menu.

XML mode: syntax and specifications

In XML mode, the design principles are the same and are based on a sample file loaded in the application. As described in Section 4.2. Creating a project, to load an xml document, it is important not to forget to go to the project Properties and check in Parameters > Mode = XML.

• The <page name="..."> … </page> tags are used to define the pages of the document. In the previous example, there is only one page. • The <field name="...">value1</field> tags represent unit-based information (the equivalent of zones in M-Designer). • The <group name="..."> … </group> tags refer to a certain number of lines containing zones, like a group in M-Designer. • The <line name="…"> … <line> tags represent the lines inside of these groups.

By analogy with a paper invoice:

  • <page name="..."> … </page> represents the pages of the invoice.
  • <group name="..."> … </group> represents the boundaries of the body of the invoice (from its first line to its last line).
  • <line name="…"> … <line> describes the contents of each line of the body of the invoice.
  • <field name="...">value1</field> can represent the following two options:
  • If this tag is outside a group, it is a unit-based element of information in the invoice. In this case, value1 represents the invoice no. in the header for example, or the client no., the type of invoice, etc.
  • If it is located inside the definition of a group, value1 refers to the value of the zone in the line. For example, the product code, description, price, etc.

b.Specifications of the XML outline

The specifications required by M-Designer are the following:

  • The XML header must specify the encoding of the file.

Example: <?xml version="1.0" encoding="UTF-16" standalone="yes" ?>

  • The root tag of the XML data must be called doc.
  • All the tags mentioned below must have at least one attribute named name. This is the attribute that identifies the information, retrieved and formatted by the application.
  • The names of the tags and attributes are case sensitive and must be written in lowercase letters.
  • In order to be accessed by the application, the data must be located in the pages between the <page name="…"> and </page> tags. A document can contain multiple pages.
  • Inside one page, the data is then organised by unit-based field (<field name="…"> tag) or by groups of information (<group name="…"> tag).
  • The groups of information are composed of lines (<line name="…"> tag).
  • The lines contain unit-based information (<field name="…"> tag).



The Spool view is then called XML View and presents the contents of the file in the form of the folder structure.


a.Data structure

The XML files, which are natively supported by M-Designer, have to be compliant, using a specific syntax, like the following illustration:

The Spool view is then called XML View and presents the contents of the file in the form of the folder structure.


  • The <page name="..."> … </page> tags are used to define the pages of the document. In the previous example, there is only one page.
  • The <field name="...">value1</field> tags represent unit-based information (the equivalent of zones in M-Designer).
  • The <group name="..."> … </group> tags refer to a certain number of lines containing zones, like a group in M-Designer.
  • The <line name="…"> … <line> tags represent the lines inside of these groups.

By analogy with a paper invoice:

  • <page name="..."> … </page> represents the pages of the invoice.
  • <group name="..."> … </group> represents the boundaries of the body of the invoice (from its first line to its last line).
  • <line name="…"> … <line> describes the contents of each line of the body of the invoice.
  • <field name="...">value1</field> can represent the following two options:
  • If this tag is outside a group, it is a unit-based element of information in the invoice. In this case, value1 represents the invoice no. in the header for example, or the client no., the type of invoice, etc.
  • If it is located inside the definition of a group, value1 refers to the value of the zone in the line. For example, the product code, description, price, etc.

b.Specifications of the XML outline

The specifications required by M-Designer are the following:

  • The XML header must specify the encoding of the file.

Example: <?xml version="1.0" encoding="UTF-16" standalone="yes" ?>

  • The root tag of the XML data must be called doc.
  • All the tags mentioned below must have at least one attribute named name. This is the attribute that identifies the information, retrieved and formatted by the application.
  • The names of the tags and attributes are case sensitive and must be written in lowercase letters.
  • In order to be accessed by the application, the data must be located in the pages between the <page name="…"> and </page> tags. A document can contain multiple pages.
  • Inside one page, the data is then organised by unit-based field (<field name="…"> tag) or by groups of information (<group name="…"> tag).
  • The groups of information are composed of lines (<line name="…"> tag).
  • The lines contain unit-based information (<field name="…"> tag).

Here is an example of an XML file:


c.XML View in M-Designer Loading an XML sample file in M-Designer is done in the same way as for a text file. In the XML view, data appear in the form as a list of elements:


d.Page break on a XML field value In the Proprieties of a group, the page break generation can now trigger on the change in XML field value. For example: <group name="groupe"> <line name="ligne">

 <field name="id">1</field>
 <field name="data"> data </field>

</line> <line name="ligne">

 <field name="id">1</field>
 <field name="data"> data </field>

</line> <line name="ligne">

 <field name="id">2</field>
 <field name="data"> data </field>

</line> <line name="ligne">

 <field name="id">2</field>
 <field name="data"> data </field>

</line> … </group>


In this example, if the used field for generating a page break is the field “id” then the page break will be generated after the execution of the second line. In the interface, it exists several options for the “Page break” parameter:

  • None: the group generate no page break.
  • Limit: the group triggers a page break on a positioning limit.
  • XML Field: the group triggers a page break on a XML field value change.
  • Limit and XML Field: the group triggers a page break on a positioning limit and on a XML field value change.

Management of the recovery of headers, when generating automatic page breaks, is possible with the options "Header" and "Last header":


  • Header: to choose the name of the line of the XML file for as header.
  • Last header: if checked, this option allows to keep only the last header. The box is checked by default.

When generating a page break, the last header (or all of the above headings, if the option is unchecked) are taken at the start of the new page. If the XML, two header lines follow, they are considered as a single header. If a page break is triggered just after a header line, it is not printed and is carried over to the next page.

Edit a variable list of items in a table

To display a list of present items in a group in a table, it must go through the script tool. The rowtable function allows to rearrange the lines of a group so as to obtain a horizontal distribution of elements. Syntax: rowtotable(group name, maximal number of columns);

The rowtable functionhas two settings:

  • Group name: contains group name to be reorganized in table, surrounded by double quotes.
  • Maximal number of columns: maximal number of columns of the table.

For example:

<group name="invoice"> <line name="item">

 <field name="name">item 1</field>

</line> <line name="item">

 <field name="name">item 2</field>

</line> <line name="item">

 <field name="name">item 3</field>

</line> <line name="item">

 <field name="name">item 4</field>

</line> <line name="item">

 <field name="name">item 5</field>

</line> <line name="item">

 <field name="name">item 6</field>

</line> <line name="item">

 <field name="name">item 7</field>

</line> <line name="item">

 <field name="name">item 8</field>

</line> </group>

To rearrange this group as a three-column table, use the following script:

rowtotable("invoice",3);

  This script will effectively change the group which then becomes:

<group name="invoice"> <line name="item">

 <field name="name_1">item 1</field>
 <field name="name_2">item 2</field>
 <field name="name_3">item 3</field>

</line> <line name="item">

 <field name="name_1">item 4</field>
 <field name="name_2">item 5</field>
 <field name="name_3">item 6</field>

</line> <line name="item">

 <field name="name_1">item 7</field>
 <field name="name_2">item 8</field>

</line> </group>

Dynamic elements

This part of the documentation presents the basic elements that can be added in the dynamic part of a project in order to get started with the main features of the application.

A) Zone

Definition

A zone is the main element, which allows you to retrieve information in the input data in order to position and format them in the final graphical document. In text mode, the information is identified by the following three elements of data:

  • a row number;
  • a column number;
  • a length.

In XML mode, it is identified by the name of the XML field (field tag). A zone can only read one row at a time. In the design space, it is represented in the following two ways:

  • The zone is empty, no data is associated with it: an icon appears in the upper right corner of the latter.
  • The zone is associated with an element of data, it appears without an icon.

A zone is identified by its name, defined in the properties window (more details in a.2 Create a zone).

Create a zone

To create the zone, you have the following two options:

  • Select the corresponding icon and its type in the Data tab and click (without releasing) the place where the element has to be positioned. This method creates an empty zone . To link the zone to an element of data of the source file, simply select the data in the Spool view (see the second method below) and drag-and-drop it in the previously created zone by holding down the Ctrl key.
  • Immediately select the data to be recovered in the Spool view and drag-and-drop it to the desired location on the design space in order to automatically create a zone linked to the selected data.

Once the zone has been created, select it and display the Properties view to enter its information:

  • Name:

Name (of the zone): information for M-Designer's internal use to identify the different objects in the project. This field is empty when creating an empty zone and is equivalent to the value of the element of data during a zone creation using the Spool view.

  • Text printed before/after: option to add text before and/or after the retrieved information.
  • Position:

Identification of the position of the information in the data spool: column, length, start line. Also used to extract a certain quantity of information in XML mode.

  • Position in the document:

Used to change the positioning of the zone on the page.

  • Data Type:

Used to define how the M-Designer application must process the retrieved information (see a.3 Types of Zones).

  • Font:

Used to set all the formatting options for the information: font, size, color, framing, orientation, etc.

Type of Zones

The M-Designer application offers various options for processing the information according to the type of data to be processed:

  • Text: used to print plain text
    • Normal: exactly reproduces the values located in the positions defined by the zone whether they are letters, numbers or blanks.
    • Optimized: reproduces the characters located in these positions except for the blanks at the beginning and at the end of these positions. Consequently, the framing to the left or to the right is always observed. There is no shift due to blanks in the spool.
    • Substitution: used to replace a value of the spool by another one stored in a file called replacevalue.txt. By default, this file is in its blank state in the installation folder of M-Designer. In order to carry out the substitutions, place it in the lgobitmap folder. It must contain the values to be replaced followed by replacement values separated by a tab. This sub-type is addressed in greater detail in paragraph 8.3. Replacing characters.
Warning-300px.png Attention: il est impératifs que le fichier replacevalue.txt ai le même encodage que le projet Onyx Designer. Par exemple, replaceValue.txt doit être unicode si le projet est unicode.
    • Translate: used to substitute a value with its equivalent translated into another language. Initially, a Tools/Set Lang type zone is used to define the file which contains the translations. For each Text/Translate zone defined in the template, the program seeks for the entry that matches the value of the zone in the file that contains the translations. This should be found in the lgobitmap folder and its name must begin with “Translate_”.
    • Compressed: area displaying the recovered text into the allocated space. The text occupies the width of the zone and adjusts the font size between a maximum and a minimum so that the text is displayed completely in the allocated space. If the minimum font size does not display the full text, it is truncated and followed by "..."
  • Truncated: area displaying the recovered text into the space allocated by the zone width. If the text cannot be fully displayed, it is truncated followed by "...".
  • Barcode: used to encode and print barcodes
  • The list of available barcodes is set out in detail in chapter 8.1 Barcode.
  • tools: used to insert a page number, images, … but also to display the (total) number of pages, of pages in the current batch, …
    • Page Number: used to number each edited page. The page number is not necessarily the same as that in the original spool. If M-Processing Server is set to exclude certain pages, the number of edited pages will not necessarily be the same as the number of pages in the original spool.
    • Batch Number: used to display the batch number.
    • Page Number (Batch): used to display the page number in the current batch.
    • Total Number of Pages: used to display the total number of pages in the entire document.
    • Total Number of Batches: used to display the total number of batches in the entire document.
    • Total Number of pages (Batch): used to display the total number of pages in the current batch.
    • Specific Replacement: replaces a value present in the spool processed by another value retrieved in a file. For example, you can replace the customer number that appears in the spool by the name of this customer that you retrieve in a database file.
    • Image: prints a different image based on a value of the spool.
    • Export: this type of zone is used to retrieve an element of information from the spool and export it to a physical file.
    • File Replace: retrieves the text stored in a file. The name of the zone must match the name of the file. This should be found in the lgobitmap folder and is called data_ZONENAME.txt (where ZONENAME is the actual name of the zone).

The row and length settings of the zone indicate the row and length of the text to be retrieved.

  • Input Text: used to create interactive input fields for designing SOAP forms in PDF or HTML format. When the user opens the form generated in Adobe Reader or an internet browser, the latter may fill in the input fields and send the data to an M-Processing Server URL, in a web entry point by clicking the SUBMIT button, given that the latter is actually a Tools/Input Text zone called SUBMIT (system name).
    • HyperLink: adds a URL link.
    • Set Lang: used to specify the file containing the translations. This should be found in the lgobitmap folder and its name must begin with “Translate_”. This particular zone cannot be printed in the final document and is not visible for visualisation or re-modelling. Although the name of this zone is not very important, it must be declared before any other M-Designer zone that requires a translation.
Then, for each Text/Translate type zone defined in the template, the program will seek the entry that matches the value of the zone in the file that contains the translations.
    • XPS Message: used to insert an XPS file in the current page. The zone is actually a link to an XPS file present on the M-Processing Server. This file can only contain one page and is found in the lgobitmap directory (directly or in a sub-directory). It is not case sensitive.

If you change the XPS file, it will affect all the projects using it.

    • XPS File: By contrast with the XPS Messages, the files inserted using the XPS File type zones:
      • can contain several pages
      • are whole pages
  • create additional pages in the output file
  • Metadata: used to index the document for archiving (not-printed data)
  • Index: area index by default and used in XPS manipulations and in M-Storage Manager as a criterion.
  • MapFrom: index reserved for sending email. The value range for this area will be used to set the email sender.
  • MapSend: index reserved for sending email. The value range for this area will be used to define the address of the recipient.
  • MapCopy: index reserved for sending email. The value range for this area will be used to set the copy recipient.
  • MapBCopy: index reserved for sending email. The value range for this area will be used to define the recipient in hidden copy.
  • MapNote: index reserved for sending email. The value range for this area will be used to define the body of the email.
  • MapSubject: index reserved for sending email. The value range for this area will be used to define the mail subject.
  • MapOrg: index reserved for sending faxes. The value range for this area will be used to identify the sender.
  • MapTo: index reserved for sending faxes. The value shown by this area will be used to define the recipient.
  • MapUser: index reserved for sending faxes. The value range for this area will be used to identify the owner.
  • MapFormat: index reserved for sending email. The value range for this area will be used to define the document format (.BMP, .JPG, .EXE, .PAG, .PDF, .TIF, .TIF_FAX, .TXT, .XLS).
  • Memory: used to insert and store information (not printed) which will be recovered and used in the template. (see 8.1.b.Combined data). Different Memory zones can be designed in order to:
  • Text: save alphanumeric information and delete the spaces after the text.
  • Text with spaces: save alphanumeric information and keep spaces after the text.
  • Integer: save integer-type digital information.
  • Float: save floating-type digital information.
  • SQL: save alphanumeric information found in a database using an SQL query.
  • Protect SQL: save alphanumeric information found in a database using a protected SQL query.
  • Math. calculation: use memory zones to perform a calculation.
  • Memory Replacement: retrieve information saved in the memory zone.
  • Memory Translate: save alphanumeric information resulting from the automatic translation of the information retrieved in the spool.
  • Graph: used to generate a graph using multiple elements of data:

Graph data X-axis data.

Y-axis data.

Graph title.

X-axis title.

Y-axis title.

Legend data.

Minimum value of the Y-axis.

Maximum value of the Y-axis.

No. of intervals of the Y-axis.

Rounding to the nearest n of the Y-axis.

Origin of the Y-axis.


The construction of a graph is detailed in section 8.6. Construction of a graph. Starting with version 8.0.2, M-Designer has the ability to automatically convert old graphs types in complex graphics. This feature facilitates the conversion of old projects in XPS projects.

  • Conversion: used to convert digital data according to the conversion rules (Euro to Dollar for example) defined in M-Processing Server > M-Designer Management > Rates (01=E1; 02=E2; etc.)

XPS PrintTicket: Copy: number of copies to print. Input Bin: input bin number (printer paper feed). Output Bin: output bin number. Media Type: Pre-printed, Pink, Thick … Force Front Side: determines the mode Single / Duplex when printing.

  • Commands: adds data in the print stream directly into printer language. As for the project properties, Document and Page (See 4.2 Creating a project), a "Commands" zone defines the printer language data for the following languages: PCL5, APFDS, PDF, ZPL, DPL, TEC, PGI, IPL and EPL. A zone can contain data for several different languages. When converting the XPS to the output language, the corresponding data to the output language will be used.

Language: language selection. Enable: enable zone for the selected language. Pre- and Post-Printing: the written data before and after the retrieved data from the spool.

The writing of hexadecimal data in the "pre" and "post-printing" is possible by using the following syntax: \x followed by the hexadecimal value of two characters.

A Group

Definition

A group can be used to retrieve several rows of a spool. It is defined by a start row and an end row. In the design space, it is shown in red:

A group can be fixed (fixed start and end rows) or variable (variable start and end rows).


Create a fixed group

To create a fixed group, you can use the same methods as when creating a zone.

  • Create a group from the Ribbon menu, select the data in the source file and drag-and-drop them in the group previously created by holding down the Ctrl key.
  • Immediately select the data in the Spool view and drag-and-drop it to the desired location on the design space to automatically create a group linked to the selected zone of the spool.

Once the group has been created, you must enter the information in the Properties view:

  • Name:

Name (of the group): information for M-Designer's internal use to identify the different objects in the project. This field is empty when creating an empty group and is equivalent to the value of the first row of the selection of data during the creation of a group using the Spool view

  • Position in the document:

Used to change the positioning of the group on the page

  • Position:

Identification of the start and end rows of the block of information to be recovered Offset: print position of the first row in relation to the group

  • Option:

Exclusive conditions: for a row of the group, a true condition will be performed exclusively without testing the following rows Table: allows zones of a group to behave like the cells of a table. Therefore, zones of the same line find themselves automatically pasted. Resize or move a zone impact size and positioning of adjacent zones. In addition, the group's lines (or conditions) are visually represented in the design window. The zones are vertically distributed according to their line. This option is detailed in paragraph 8.5.b. Draw a dynamic table.

  • Variable:

Used to change the type of group: from fixed (the start and end rows are static) to variable (the Given that the limits of the data selection zone are defined using the Start line and End Line fields of the group, the data must now be retrieved by creating one or more Zones inside the group.

  • Summary:
  • The selection zone of the data block is configured by creating a Group:
  • The data is retrieved inside this block of data by creating a Zone:
  • We can then see that all the rows of our block of data are retrieved using the preview function (Ctrl+W). It is possible to create several Zones from the data block, place them in the group and condition their page layout (see 6.4.c. A condition).

Create a variable group

The principle of the variable group is identical to that of the fixed group, i.e. it can be used to retrieve several rows of information in the spool. When the start and end row of the group is not always in the same place in the spool or you do not want the information to be always printed in the same place in the page, then you must use a variable group . A variable group uses a start condition and an end condition. The group begins to run when a condition is validated and it stops when another condition is validated or when it has executed a certain number of rows. A variable group can be performed once or more times in the page.

Furthermore, the position of the values printed by a variable group can be variable. For example, you can define the settings so that the values printed by a group are positioned after the values printed by another group . We refer to this as relative positioning. You can also define the settings so that the invoice total is always printed one centimeter after the last row of the detail (whether there are 5 or 20 rows). The position of the invoice total will therefore change according to the number of rows of products in the invoice, for instance.

A group may vary in:

  • size: the start and end rows are dynamically set by the conditions ,
  • print position: variable groups can be linked one after the other so that the following group is printed straight after the current group finishes.

These two types of variable can exist separately or jointly.

To create a variable group, simply click the icon and draw the group in the design space.

The Properties view is displayed so that the group information can be entered:

  • Name:

Name (of the group): information for M-Designer's internal use in order to identify the different objects in the project. This field is empty when creating an empty group.

  • Position in the document:

Used to change the positioning of the group on the page.

  • Position:

Offset: print position of the first row in relation to the group.

  • Option:

Exclusive conditions: for a row of the group, a true condition will be performed exclusively without testing the following rows Repeat: if the start condition appears several times, the group will run several times provided that the end condition has been validated in the meantime MapOffice: To be checked in order to design a MapOffice group (refer to the M-Connect documentation for Office document rules of design). Table: allows zones of a group to behave like the cells of a table. Therefore, zones of the same line find themselves automatically pasted. Resize or move a zone impact size and positioning of adjacent zones. In addition, the group's lines (or conditions) are visually represented in the design window. The zones are vertically distributed according to their line.

  • Variable:

Used to change the type of group: from fixed (the start and end rows are static) to variable (the start and end rows are variable and defined by conditions). Spacing: spacing before the printing of the group. Type of stop condition: used to condition the end of the execution of the variable group, with a condition or a fixed number of lines. Previous group: refers to the group after which the variable group is executed.

A Condition

Execution condition

The execution conditions are used to run, or not run, the object conditioned in accordance with a value in the spool. A condition can apply to a page, a component, a group, a zone, a line or a rectangle.

If the condition is valid, the object is executed. Otherwise, no further action is taken. In order to complete two different actions depending on the presence of a spool value or not, you must create two objects.

Example: You want to write in black for an Invoice value and in red for a Credit note value in a spool row. You must then create a zone with a black font when it is an Invoice, and a zone that uses a red font when it is a Credit note because you cannot create the following unique condition for a particular zone: "black font if Invoice and red font if Credit note".

The conditions are managed differently if the object is fixed or if it belongs to a group. Indeed, in a group, the condition is named and linked to the group. Therefore, we can associate multiple objects to a single condition without having to re-enter the latter each time.


Start condition

The start condition defines the first row for the execution of the variable group. The group begins to run on the row where the start condition is true.

M-Processing Server tests the validity of the condition from the first row of the spool (row 1). As soon as the condition is verified, the group begins to run. It stops when the end condition is verified in its turn.
The start condition is used to determine if the group is to be printed at a fixed position on the page or in a relative positioning in relation to another group. It is also possible to set it so that the group is printed one centimeter after the end of another group.

If the start condition for the group is not verified on any of the rows of the spool, the group is not executed. If the start condition is verified on several rows of the spool, the group runs only once: from the first row where the condition is verified.

End condition

The end row of a variable group can be defined in two ways:

  • number of execution rows,
  • end condition.

By knowing the number of rows for which the variable group must run, it is possible to set the input number after you have ticked Number of lines. The stop condition is not a comparison test in relation to a value present in the spool but the row number after which the group stops.

The end condition sets the last row for the execution of the variable group. The group stops running on the row where the end condition is true. Furthermore, this row can be excluded (not executed) or included (executed).

c.4. Exclusive condition In a group, it is possible to manage several conditions. By default, there is only one which is the None condition that applies for all newly created zones. That condition is always TRUE (valid).

Example: In a group containing product rows, there may be rows of sub-totals. It is possible to use several zones for printing these different types of row (to display the sub-totals in bold for example) using a condition.

In this case there are basically two conditions: a Sub-total condition, which is linked to at least one zone that prints in bold and the None condition, which is linked to the zone that has standard writing for the product rows. If the group operates using exclusive conditions, a single condition is applied per row, even if several are true (only the first created condition is applied). The product rows are printed as standard by the zone under the None condition and the rows of sub-totals are printed in bold by the zone under the “Sub-total” condition.

If the group operates using non-exclusive conditions, all the verified conditions are applied by row. In this case, the sub-total rows are printed twice, once in bold by the zone under the Sub-total condition and once as standard by the zone under the None condition. Indeed, the None condition is always true, as mentioned previously.

Operation using non-exclusive conditions is very rarely used. It requires adding the reverse conditions to other conditions in the filters of a condition. In this type of operation, the None condition is not used. It is only used to repeat the printout of an element of information, or to print the information contained on a single spool row, on two rows.

The None condition cannot be deleted. If you do not want to use it, do not link it to an object.


Comparison type

When setting the conditions, you can test:

  • The existence in the row: there is in a row or in the entire page.
  • The non-existence in the row: there is not in a row or in the entire page.
  • Strict greater than (digital): >.
  • Equal to or greater than (digital): =>.
  • Strictly less than (digital): <.
  • Equal to or less than (digital): =<.
  • The number of the page.
  • The number of the row.

These tests are used by M-Designer to validate a condition or not.

Generate a project

Once the template has been completed, all that remains to be done is to generate it for its use in M-Processing Server. To do this, click the Generate the project button of the Home menu. When the Save Project window opens, check that the generation path is correct. By default, the project is generated in the docpc directory of the Import folder.

  • Unix: /apps/mapping/import/docpc/
  • Windows:  C:\Mapping\M-Processing Server\Import\docpc\
  • iSeries:  /home/mapping/docpc/

A post-generation window opens once the project has been generated to notify you of the result(s) of the generation. The template is now ready to be imported in M-Processing Server.

Advanced features

Barcode

Creation of a barcode

To create a barcode in M-Designer, simply create a Barcode type zone and select the required barcode sub-type. Note: The 1D barcodes use fonts (you should download Mapping Fonts on the technical server at the http://server.mappingsuite.com). The 2D barcodes are images and do not require any font selection in M-Designer.

The types of barcodes
  • EAN 8

This barcode is used to track logistics units and identify stock keeping units. The eight characters version is used for small sized packages. The data must contain seven digits. The eighth character is a check digit which is calculated by the computer.

  • EAN 13

This barcode is used to track logistics units and identify stock keeping units. In an EAN 13 code, the first two characters are the identifiers of the country of origin, the other 10 are the data and the last is the check digit which is calculated by the computer. The data must contain 12 digits.

  • Code 39

This barcode is used to encode alphanumeric data. It is used in almost every industry except the retail sector. The data may be of variable length and may contain letters and digits. The information can be of any length and contain digits, uppercase letters and the “space”, “plus sign”, “minus sign”, “division”, “dot”, “percentage” and “dollar” characters.

  • Code 128

The information to be encoded can be of any length and composed of:

Optimised: digits, uppercase letters, lowercase letters, printing or non-printing ASCII characters (0 - 128), and all the function signs and characters provided by the Code 128 in the A, B and C code sets, with systematic length optimisation. N/Optimised: digits, uppercase letters, lowercase letters, printing or non-printing ASCII characters (0 - 128), and all the function signs and characters provided by the Code 128 in the B code set, without length optimisation Digital: digits and check character provided by the Code 128 in the C code set, with systematic length optimisation

They are used to encode general alphanumeric data and ASCII data. These barcodes are used in many industries for stock management purposes. The data is of variable length. The Code 128 C must contain an even number of characters (otherwise a zero is added at the beginning of the barcode) and may only contain digits. The Code 128 B accepts all ASCII characters, whereas the Code 128 A accepts only some of them.

  • Code 2/5 interleaved

This encoding of numbers is used to enter information about the density of products, in response to precise specifications. The security of this symbology is weak, except when using optional security measures (check character, messages of fixed length that are checked when scanning). Although the length of the barcode is unlimited in terms of the number of characters, the principle of interleaving requires the following: an even number of digits when the optional check character is not used an odd number of digits when the optional check character is used

  • Code 2/5 industrial

Digital information encoding that is designed for its ease of use Development or modification of pre-existing applications

This old symbology was frequently used in industry, particularly the automotive industry. The security of this symbology is weak, unless it is used with messages of fixed-length and checked when scanning. The data must contain 1 to 32 digits.

  • EAN128 Alpha n/optimized

Encoding of alphanumeric information Variable length Continuous bidirectional self-checking

Used for identifying dispatch units (pallets or cartons, possibly).

 EAN128 digital • Encoding of digital information • Variable length • Continuous bidirectional self-checking

Used for identifying dispatch units (pallets or cartons, possibly).

  • PDF 417

Two-dimensional Alphanumeric 2000 length Eight levels of security

Used in every sector of activity. The PDF417 code is the only two-dimensional barcode that can be scanned using a simple linear scan (1D) due to the fact that, as stacked linear symbology, it has the features of linear barcodes as well as two-dimensional ones.

  • Data Matrix

This code can encode up to 2335 characters. Various types of encoding are available (ASCII, C40, text and Base 256). The default mode is the automatic mode which can be used to optimise the encoding by swapping from one mode to the other depending on the data. It also has an error detection/correction system for repairing any damage.

  • Postnet

The Postnet barcode is used by the United States postal service. It has been replaced by the USPS or Intelligent Mail barcode.

  • Planet

The Planet barcode is used by the United States postal service. It has been replaced by the USPS or Intelligent Mail barcode.

  • QR Code

It has the particular feature of being able to encode a very large number of characters (7336 in numeric mode). This type of barcode is very widespread in Japan. There are four types of encoding (alphanumeric, numeric, bytes, Kanji) for compressing the data by varying degrees depending on the type of data. By default, an automatic mode is used to choose the encoding method that will give the best compression rate (switch of mode while processing). Error detection/correction codes are added to the data, which are used to prevent the loss of data in the event of damage. There are four levels of error detection/correction.

  • MaxiCode

The MaxiCode barcodes, developed by UPS - United Parcel Service, are defined by the ISO 16023-2000 standard. Unlike the others, it has a set size, which limits the number of characters to be encoded. Indeed, the maximum number of characters is 93 alphanumeric characters or 138 numeric characters. There are two types of encoding. The first only encodes a string of characters containing data according to a conventional type of encoding and a standard type of error detection/correction. The second type encodes the following three fields in addition to the string of data: the country which is encoded using 3 digits according to the ISO 3166 standard, the postal code which is encoded using 6 characters and finally a type of service using 3 digits. These three fields are encoded using an extended error correction mode contrary to the string of data whose correction mode is standard.

  • Japan Postal

The Japan Postal barcode is used by the Japanese postal service.

  • Codabar (NW7)

In Japan, the Codabar Monarch is also called NW-7. The relatively simple composition of the Codabar Monarch means that it is frequently used to encode serial numbers for applications involving blood bank transfusion services, home deliveries, libraries, etc.

  • USPS

USPS = United States Postal Service. The more commonly used official name is the Intelligent Mail Barcode. It is the new American postal barcode, which is to replace the Planet and the Postnet. The Intelligent Mail barcode is a 4-state barcode composed of 65 bars.

  • UPC-A

The UPC-A barcode is a U.S. equivalent of the EAN13 barcode, the first digit of which is 0. It is used primarily to identify products in store. The UPC-A barcode can encode 11 digits, a number system, five digits for the Manufacturing Code and five digits for the product code. A 12th digit is calculated using the first eleven in order to act as a check digit. Font used: BCUPCA.ttf

  • UPC-E

The UPC-E barcode is a short version of the UPC-A barcode, in which the ten digits of the UPC-A barcode (manufacturing and product code) are reduced to six digits by removing superfluous zeros. With the Number System and the check digit, a UPC-E barcode is therefore composed of eight digits. M-Designer can be used to include UPC-A (11 digits) barcodes in the UPC-E format as well as a code reduced to 6, 7 or 8 digits. Font used: BCUPCE.ttf

  • MSI

The MSI barcode is used primarily for stock management, marking storage containers and shelving in warehouse environments. An MSI barcode uses one or two check keys calculated using the Modulo 10 or Modulo 11 methods and is used to encode numeric values of indefinite size. M-Designer can encode using either a Modulo 10 check key, a Modulo 11 check key, two Modulo 10 check keys, or even a Modulo 11 check key followed by a Modulo 10 check key. Font used: BCMSI.ttf without label and with label: BCMSIL.ttf

The size of the barcode

The size of the barcode can be defined in the following two ways:

  • The first involves choosing the Fit the area option in the Properties view, in which case the barcode will be adjust as well as possible to the size of the zone, according to its standard.
  • If the Fit the area option is unticked, the size of the barcode can be set by the size of the font of the zone. This size affects the width and the height of the code. The height can be reduced by reducing the percentage of the height setting of the zone.

Comment: In order to label a barcode, simply select a labelled font.

Combined data

It is possible to combine data found in different places in the spool within a single barcode. In order to achieve this, it is necessary to create as many memory zones as there are elements of data to be retrieved from the spool and then all these zones must be combined in the label of the barcode zone.

In the Map F tab:

In the Properties view:

In this example, the Memory zone have the values:

  • MEM_FACT : 0012601
  • MEM_DTFACT : 14/10/99

Result:

It is also possible to add text that is not found in the spool using the Memory zones (detailed in paragraph 6.4.a.3 Type of zones): MEM1TEXTMEM2.

If you use replacement zones in a Barcode zone, the Length of the barcode zone must be equal to 0.

Special case: EAN128

The encoding of the EAN128 is identical to the encoding of the Code128. That is why we use the same fonts. The difference is that the EAN128 is structured in order to standardize the information that it contains. To achieve this, an AI (Application Identify) is inserted between each piece of information, which is used to identify the data encoded.

Structure of the EAN128: START FNC1 AI DATA (FNC1) AI DATA .... (FNC1) AI DATA CRC END

FNC1: Separator character of the EAN128. AI: Application Identifier, is used to encode several standardized elements of information in one code (date+time+etc.)

The first FNC1 is automatically added by M-Designer. It is required as it is used to differentiate an EAN128 barcode from a CODE128 barcode. However, the following FNC1 are optional. Indeed, they are only required when the previous element of data does not have a fixed length, in which case they are used to separate each element of data.

If you want to insert the FNC1 character, you have to put the paragraph (§) character in your spool. This character will automatically be replaced by FCN1 characters by the M-Processing Server.

Example: SPOOL ----> MAPPING AI DATA ----> START FNC1 AI DATA CRC END AI DATA § AI DATA ----> START FNC1 AI DATA FNC1 AI DATA CRC END

If you cannot change your spool to add the "§" character or if you want to combine several elements of data that are located in different places in the spool (see previous paragraph: 8.1.b. Combined data), you can use the memory zones.

Please note: The AIs of the EAN128 barcode label must be in brackets. This is not managed by the barcode fonts, so you have to create a text zone under the barcode in order to add the label.

Special case: code 128

There are three encoding modes for 128 barcodes: A mode (alphanumeric)

B mode (alphanumeric). The code 128 Alphanumeric encodes in B mode

C mode (numeric). The code 128 Alphanumeric encodes in C mode.

The code 128 Alphanumeric Optimized switches from B mode to C mode automatically in order to optimize the size of the barcode. However, your barcode may have to comply with a specific type of formatting, i.e. a certain number of characters in A, B or C mode. For example, the barcode that corresponds to the mail tracking ID of "La Poste" contains 13 characters. The first three must be encoded in B mode and the last ten in C mode.

In order to create this barcode using M-Designer, you must create a "Code 128 N/Optimized" type zone and then enter a formatting screen in the Advanced options of this zone.

Example: For the following data: 1J45034500751

You want to encode:

  • the first three characters (1J4) in B Mode
  • the last ten characters (5034500751) in C mode

Your formatting mask must therefore be BBBCCCCC.

You will notice that although there are ten digits to be encoded in C mode, there are only five 'C's in the formatting mask. This is due to the fact that one character in C mode encodes two digits.

Special case: Codabar

It is possible to create documents containing Codabar type barcodes (also known by the name of NW-7 in Japan). Given that this type of barcode does not require encoding or check characters, there is no "CODABAR" type zone in M-Designer. In this case, simply create a text zone that uses the BCCodabar or BCCodabarL font. However, this type of barcode must begin with a start character and an end character (character A, B, C or D).


If the start and end characters are not present in your data, you will need to do the following:

1)Create a memory zone to contain the data of the barcode. 2)Create a memory replacement type zone to contain the element of data plus the start and end character. This zone must use the BCCodabar or BCCodabarL font.


Special case: 2D Barcode

Currently, MAPPING manages four types of 2D barcode: PDF417, DATA MATRIX, QR CODE and MAXICODE.

In PCL5 and PDF: PDF417 - DATA MATRIX - QR CODE - MAXICODE In ZEBRA: PDF417 - DATA MATRIX

These barcodes do not require the selection of any special fonts. In PCL5 and PDF, the "Barcode width" setting is used to change the size of the barcode. In ZEBRA, the selected font size is used to change the size of the barcode.

The benefit of 2D barcodes is being able to encode a number of important pieces of information. If the data that you need to encode is located in different places in the spool, go to paragraph 8.1.b. Combined data in order to combine them in a single barcode. Please note that this type of barcode manages optimizations (switching from alphanumeric to numeric) and the size of the barcodes may therefore vary in height and width depending on the content to be encoded.

QR code

The QR CODE barcode was developed according to the International ISO/IEC 18004 standard. It has the particular feature of being able to encode a very large number of characters (7336 in numeric mode).

This type of barcode is very widespread in Japan. It is already used in industry, but has also been adopted by the general public since mobile phones have been able decode it.

There are four types of encoding (alphanumeric, numeric, bytes, Kanji) for compressing the data by varying degrees depending on the type of data. By default, the automatic mode is used to choose the encoding method that will give the best compression rate (switch of mode while processing). For example, let us assume that the beginning of the string contains alphanumeric type data. As soon as the program detects a string of at least 13 numeric characters, it changes encoding mode.

Error detection/correction codes are added to the data. These codes prevent losing data through damage. There are four levels of error detection/correction. By default, level three is used, whose codes use approximately 25% of the final barcode.

Available advanced options: Barcode width: Value between 1 and 15 specifying the size of the barcode

Error Level: (7%, 15%, 25% and 30%)

FCN1:

  • ECI protocol not implemented
  • ECI protocol not implemented, FNC1 implied in first position
  • ECI protocol not implemented, FNC1 implied in second position In the last case, a separator character (Application identifier) must be specified.

Application Identifier: Separator character, used only with the implicit FCN1 in second position.

  • Type of encoding:

AUTO: Automatic encoding of the data with a mode change depending on the data

ALPHA: Alphanumeric encoding

NUMERIC: Numeric encoding

BYTE: Encoding in bytes

DATAMATRIX

The Datamatrix barcode is defined by the International ISO/IEC 16022 (ECC200) standard. This code can encode up to 2335 characters.

Various types of encoding are available (ASCII, C40, text and Base 256) and the default mode is the automatic mode that can be used to optimize the encoding by swapping from one mode to the other depending on the data.

It also has an error detection/correction system for repairing any damage.


Advanced options:

  • Barcode width: Value between 1 and 15 specifying the size of the barcode
  • Type of encoding:

AUTO: Automatic encoding of the data with a mode change depending on the data

oASCII: The ASCII encoding is a tacit plan for encoding the ASCII data.

C40: C40 encoding transforms 3 alphanumeric characters into two code words.

TEXT: The Text encoding is used to encode the lowercase characters.

PDF 417

The PDF 417 is defined by the International ISO/IEC 15438 standard. This type of barcode can encode up to 2700 numeric characters.

There are three types of data encoding (alphanumeric, numeric and bytes). The automatic mode chooses the best compression rate and changes the mode while encoding.

There are also eight levels of error detection/correction mode. In automatic mode, the level is chosen according to the number of characters to be encoded.

Advanced options: Barcode width: Value between 1 and 15 specifying the size of the barcode

Error Level:

  • AUTO: automatic choice.
  • 0 - 8

Compact mode: Activation of the compact mode or not.

Ratio: Used to determine the height/width ratio of the barcode

Fixed columns: Used to define the number of columns.

Fixed rows: Used to define the number of rows.

The selection of a ratio prevents you from specifying the number of rows and columns.

UPS MAXICODE

This type of barcode, developed by UPS - United Parcel Service, is defined by the ISO 16023-2000 standard. Unlike the others, it has a set size, which limits the number of characters to be encoded. Indeed, the maximum number of characters is 93 alphanumeric characters or 138 numeric characters.

There are two types of encoding:

  • The first only encodes a string of characters containing data according to a conventional type of encoding and a standard type of error detection/correction.
  • The second type encodes three other fields stored in three of M-Designer's memory spaces, in addition to the string of data. These fields are: the country encoded using 3 digits in accordance with the ISO 3166 standard (called MAP_countr), the postal code encoded using 6 characters (MAP_zipcod) and finally a type of service using 3 digits (MAP_servic). These three fields are encoded using an extended error correction mode contrary to the string of data whose correction mode is standard.

Available advanced options: • Barcode width: Value between 1 and 15 specifying the size of the barcode

Automating

The automating of M-Designer allows you to create image files corresponding to the preview of a project as well as generate a project or an association of projects. All this can be done from the command line, in hidden or non-hidden mode.

The idea is to build the command with a .BAT file or a remote command, for example.

  • InFile: .PAG or .XML file to be modelled
  • OutFile: Output image file
  • ProjectFile: Project to be opened (.MPP)
  • ProjectAsso: Project association to be generated (.MPA)
  • MPIFile: .MPI file to be opened (MAP tab)
  • MPWFile: .MPW file to be opened (DRAW tab)
  • Hide: To launch M-Designer in hidden mode
  • Colour: Use of color or not to create the image
  • Rotation: Rotation angle of the image (default: 0)
  • Resolution: Image resolution (default: 300)
  • Specimen: Adding a text above the image (text to be specified in the argument)
  • Mode: Choose SPOOL or XML mode (default: SPOOL)
  • Generate: To start generating the project indicated in the argument
  • Lang: Generation language (default: PCL5)


  • 0: PCL5
  • 1: PCL5 OPTIMISED
  • 2: PCL5 IMAGE
  • 3: AFPDS
  • 4: PDF (Projects must be associated for generating in PDF)
  • 5: ZEBRA
  • 6: DPL
  • 7: IGP
  • 8: TEC
  • 9: IPL
  • 10: F+D
  • 11: EPL

SubLang: Generation sub-language (default: 0). Depends on the generation language

  • PCL5, PCL5 OPTIMISED, PCL5 IMAGE:
  • 0 = PCL5e (default)
  • 1 = PCL5
  • AFPDS:

0 = 4028 Compatible

1 = Resident Font

3 = Font Collection (default)

  • DPL:

0 = Macro Standard

1 = Send Standard

2 = Macro Mainframe (default)

3 = Send Mainframe

  • IPL:

0 = Bitmap Font

1 = True Type Font (default)


  • GenColour: Color generation (= 1) or black and white (= 0) (default: 0)
  • Active: Active mode, only for AFPDS language (0 or 1) (default: 0)
  • Res: Resolution of the generation. Depends on the language of generation:

PCL5, PCL5 OPTIMISED, PCL5 IMAGE: 300 or 600 (default: 300) AFPDS: 240, 300 or 600 (default: 240)

PDF: 300 or 600 (default: 300)

ZEBRA: 152, 203, 300 or 600 (default: 152)

DPL: 152, 203, 300 or 600 (default: 152)

IGP: 72, 152, 203, 300 or 600 (default: 72)

TEC: 203 or 300 (default: 203)

IPL: 203 or 300 (default: 203)

F+D: 203 or 300 (default: 203)

EPL: 203 or 300 (default: 203)

  • Overlay: Generate page background (0 or 1) (default: 1)
  • Font: Generate font (0 or 1) (default: 1)
  • FtpUse: 0 = does not use FTP; 1 = uses FTP
  • FtpFolder: FTP directory
  • FtpLogin: FTP login
  • FtpPassword: FTP password
  • FtpIPAddress: IP address of the server
  • ShareFolder: Share directory
  • ServerName: Name of the server (description)
  • Rename: changes the FORMAT and SEQUENCE of the project using its name. Example: Facture00010.mpp
  • MVM: Opens M-Designer in MappingVersionManager mode


Example 1: Project generated in PCL, in color and 300 dpi C:\Mapping\M-Designer\M-Designer.exe "-Hide" "-ProjectFile:C:\Mapping\M-Processing_Server \Import\docpc\test.mpp" "-Generate" "-Lang:0" "- GenColor:1" "-Res:300"

When using the "-Generate" setting (indicating a project generation), the "-ProjectFile: " or "-ProjectAsso: " setting must be present in order to identify the project to be generated. If the "-ProjectFile: " and "-ProjectAsso: " settings are present, the project will take priority for the generation and the association of projects will be ignored.


Example 2: creating a colour BMP image, with a 90° rotation, in 203 dpi and with the word SPECIMEN overlaid C:\Mapping\M-Designer\M-Designer.exe "-InFile:c:\test.xml" "- OutFile:c:\image.bmp" "-ProjectFile:C:\ Mapping\M-Processing_Server \Import\docpc\test.mpp" "-Hide" "-Rotation:90" "- Resolution:203" “-Color” "-Mode:XML" "-Specimen:SPECIMEN"

In order to create an image, the "-InFile " and "-ProjectFile" settings are mandatory. If "-Outfile" is absent, the output file takes the name of the input file with the extension .BMP.

The default mode is SPOOL. If the input file is an XML file, you have two specify the mode.

Replacing characters

The objective is to explain how to replace a string of characters in the input file by another string of characters.

The operating principle involves using a text file as a conversion chart between the value to be replaced and the new value.

The following is required in order to use the conversion chart:

  • Define the zone using the Type mode = Text / Sub-type mode = Substitution.


Finish and generate the template.

Open the ReplaceValue.txt file in a text editor (like Notepad, but not Word). The syntax of the file is as follows: Value to be replaced Tab New Value

In this case, the "]" character will be replaced by the ">" character and "Nom" will be replaced by "Name" (if the value to be replaced is located in a Text\Substitution type zone).

Save the ReplaceValue.txt file in the lgobitmap sub-directory of Mapping (\home\mapping\lgobitmap by default on iSeries and /apps/mapping/import/lgobitmap on Unix)


Generate a template in PDF (by association of projects)

This method by Association of projects is required to generate a template in PDF language but it can also be used for all the other languages supported by M-Designer.

To create an association of projects, simply click File > Association of projects > New A window to select the projects concerned opens:


You must select the .MPP files that you want to associate. Then click the Save button to save your project association. The file will have the .MPA extension. Once the file has been saved, click Generate.

The generation by association of projects is complete. All that remains is to import your templates to your production system.

Draw a table

Static table

In order to create a perfectly drawn and aligned table without using the Static Table tool of the Fixed layout view, you need to complete the following steps:

start by drawing the rectangular outline of the table,

draw the vertical lines to define the columns,

draw the horizontal lines needed to create any rows you may require (column headers for example),

finally select all the elements of the table and press the lowercase "a" key on the keyboard:


Comment: This design aid can be used in the Fixed layout view and Dynamic layout view of the project. In the Dynamic view, you can draw a table inside a Group and place, for example, an execution condition on a horizontal line to dynamically draw a line for each new row of data.

Dynamic table

As announced in the options available for a group (see paragraph 6.4.b.2. Create a fixed group), the table mode allows to zones of a group to act as the table cells. The zones of the same line therefore find themselves automatically pasted.

Remark: Resize or move a zone has an impact on the adjacent zones size and positioning. The group's lines (or conditions) are visually represented in the design window. The zones are, on the other hand, vertically distributed according to their line.

Construction of a graph

From the Map part: Create a graph from the tab Graph:


Name it (here “GRAPH1”):


From there, the complex graph can be constructed in two different ways, presented below.


By selecting zones one by one

  • Select, in the spool, the zones that will be used in the graph,
  • In the Properties, for each defined zone:
  • Name them all with the same name as the graph (here it will be “GRAPH1”)
  • Enter the Type = “GRAPH”


Depending on the utility of the area in the graph, select the corresponding Sub-type in the proposed list:

  • Go to the Graph Properties and click Edition:
*Set your chart by choosing from the tabs:

Type:

  • Name of the graphic: which will be included in the names of the zones,
  • Number of zones: that will compose the chart,
  • Graph type: Pie, Bar, Line chart


NB: For the graph type = Bar chart, it is possible to define the spacing between the bars on the right and on the left (in%). This option can be used, for example, to overlay two graphs by playing on the bar spacing of each graph.



Properties: allows to choose the fill, the border, the width of the outline, the fill type, ...

Positioning: allows to place the titles (X, Y, of the graph) and the legend , to resize the graph according to the preferences of the user.

NB: The print area of the graph is the area delimited by the large rectangle so everything that will not be in it will not be visible when printing (e.g.: the "Legend" area is outside the rectangle in the first image below while it is in in the second).


- The Legend is constructed by selecting the zones in the spool that will serve as legend for the chosen attributes. As with any other data, you must name the field as the name of the graph and enter the properties of the field with Type = "Graphic" and Sub-type = "Data of the legend".

NB: Be attentive to respect the order of the data selection by defining the zones that will serve to the legend because they will follow the same order as the one of the attributes.

By creating a group

The principle is the same as that described above except that the data is grouped into a group. This option is possible if the data of the chart follow in the spool.

Create a group that will define the data to be taken into account for the construction of the graph and to deposit the selected zones that contain data, titles, legend …

Name the zone(s) with the same name as the graph and enter its properties with Type = “Graph” and the Sub-type according to the role of the zone (title, data, legend …).

The remainder of the construction of the graph is the same as that described above.

Calculation in a group

To simplify the calculation management into a group and especially the management of “total” and “subtotal”, a tool has been integrated within M-Designer. It allows to perform processing on an input XML file using scripts. These scripts are executed before the application of the template.

Adding of the calculation into a group through this tool is by the “addline” script function. The addline function adds a line to a group specifying a sequence of pairs “field name / value” to add. In addition, the “string” type parameters must be surrounded by double quotes and field names in formulas by single quotes.

Syntax:

addline(group name, line name, page break type line, name of the first field, value of the first field, pre-calculation of the first field, name of the second field, value of the second field, pre-calculation of the second field, etc…); The addline function starts by the following arguments:

  • Group name: contains group name where the line should be added.
  • Line name: line name to add.

Then, it consists of an unlimited sequence of field / value pairs:

  • Field name: field name that has the line
  • Field value: field value possessed by the line
  • Yes: The calculation is resolved during the script execution, taking into account all the XML values.
  • No: The calculation is solved when using the value in a template and therefore takes into account only the values in the current page.

For example, the following script adds a line to the group named “group”:

addline("group","line",yes,"field1","value1",no,"field2","value2",no);

<group name="groupe"> … <line name="ligne" pagebreak=”1”> <field name="champ1">valeur1</field>

    <field name="champ2">valeur2</field>

</line> </group>

If the field value contains a calculation then the syntax is:

SUM(operation) for calculating a sum over all the groups of lines.

AVG(operation) for calculating an average over all the groups of lines.

In this example, “operation” is a mathematical calculation using field names in lines of the group. Field names must be surrounded by single quotes.

For example:

<group name="invoice"> <line name="item">

 <field name="name">item 1</field>
 <field name="price">10</field>
 <field name="quantity">2</field>

</line> <line name="item">

 <field name="name">item 2</field>
 <field name="price">5</field>
 <field name="quantity">3</field>

</line> <line name="item">

 <field name="name">item 3</field>
 <field name="price">12</field>
 <field name="quantity">4</field>

</line> <line name="item">

 <field name="name">item 4</field>
 <field name="price">5.5</field>
 <field name="quantity">3</field>

</line> </group>

For adding a total line of this group, use this script:

addline("invoice", "LigneTotal",no 

"total", "total = SUM('price'*'quantity')", yes "moyenne", "moyenne = AVG('price'*'quantity')", yes );

This script adds a total line at the end of the group:

<group name="invoice"> … <line name="item">

 <field name="name">item 4</field>
 <field name="price">5.5</field>
 <field name="quantity">3</field>

</line> <line name="LigneTotal">

 <field name="total">total = 99.5</field>
 <field name="moyenne">moyenne = 24.875</field>

</line> </group>

Using the Pre-calculation option to “no” allows to not execute calculations when adding the line to the group but when executed by the template. The advantage of this option is to perform calculations only with the written data on the current page, thus allowing the writing of subtotals.

To add a subtotal line to the previous group, use this script:

addline("invoice","LineSubtotal",yes,"subtotal","sous-total = SUM('price'*'quantity')",no);


This script adds a total line at the end of the group:

<group name="invoice"> … <line name="item">

 <field name="name">item 4</field>
 <field name="price">5.5</field>
 <field name="quantity">3</field>

</line> <line name="LineSubtotal" pagebreak=”1”>

 <field name="subtotal">sous-total = SUM('price'*'quantity')</field>

</line> </group>c

Pagination management

Information writing management of the pagination such as the total number of page, the number of the batch and the number of pages in the batch is possible in M-Designer through the following two options:

Batch breaking

The “Batch breaking” option is in the Properties of the template (see paragraph 4.2.Creating a project). It defines a Metadata type zone which will be used to group the pages of the final document in batch.

During page processing:

  • If the Metadata type zone retrieves a new value then a new batch will be created. The current page will belong to this new batch.
  • If the Metadata type zone retrieves a value already previously recovered, the current page will be moved to the batch corresponding to that value.
  • If no value is recovered by the Metadata type zone, the page remains in the same batch as the previous page.

The multi-document system of XPS is used to represent the batch, the output file is sorted by sequence (first pages of the first batch and the second pages, etc ...).

Replacement variables

To enable information writing of pagination, there are “post-treatment” type variables, that is to say they will be replaced by their real value at the printing time. These variables can be used into zones or in text blocks: MAP_TOTAL_PAGE = total number of page. MAP_TOTAL_DOC = total number of batch. MAP_TOTAL_PAGE_IN_DOC = page number in the current batch.


The used syntax is as follows:

[[PST: variable name; default value]] The “default value” is mandatory and allows to having a text in the page. This temporary text will be replaced by its real value. It is important because it is through this text that the positioning calculations will be. This text must therefore have a number of character at least equal to the maximum value expected by the used variable. For example: PST:MAP_TOTAL_PAGE;000

Displays “000” in the page, but at the printing time this value will be replaced by: - " 5" if there are 5 page in total. - " 10" if there are 10 page in total. - "150" if there are 150 page in total. Others syntaxes also exist, accessible during the processing of the page: [[VAR:MAP_CURRENT_PAGE]] = current page number [[VAR:MAP_CURRENT_DOC]] = current batch number (the Metadata zone managing the batch breaking must be defined before using this variable). [[VAR:MAP_CURRENT_PAGE_IN_DOC]] = current page number in the current batch. And in general: [[VAR:variable d’env]] = retrieve the contents of the environment variable.

Widows-and-orphans management

Complex management of widows and orphans is possible through two features: the Entire group and the repetition of XML group.

Entire group

When we use a limit type of page break generation, a new option appears in the group properties: Entire group. This option specifies that the group cannot be cut and it must be printed in full on a single page. If the limit triggers a page break, no line of the group will be printed, the group will be fully processed on the next page.

XML group repetition

The XML group repetition assumes that the group appears several times in the input XML file. This feature is enabled with the parameter "Repeat" in the group properties.

Example: In the example below, the group "invoice" appears three times in the XML. By default, the group of the template will retrieve the information from the first appearance of the group in the XML. But if the "Repeat" option is checked, the execution of the group will continue on all occurrences. <group name="invoice"> <line name="item">

 <field name="name">item 1</field>
 <field name="price">10</field>
 <field name="quantity">2</field>

</line> <line name="description">

 <field name="description">Description item 1</field>

</line> </group> <group name="invoice"> <line name="item">

 <field name="name">item 2</field>
 <field name="price">5</field>
 <field name="quantity">3</field>

</line> <line name="description">

 <field name="description">Description item 2</field>

</line> </group> <group name="invoice"> <line name="item">

 <field name="name">item 3</field>
 <field name="price">12</field>
 <field name="quantity">4</field>

</line> <line name="description">

 <field name="description">Description item 3</field>

</line> </group> The cumulative use of a boundary generating page breaks with the "Entire group" and active repetition allows to manage a complex system of widows and orphans. In our example, the lines "item" and the lines "description" cannot be separated by a page break.