On line guide/help
You are on page 7 of the online help. Navigate sequentially through the guide pages or search for a topic of interest to you.
Index Prev. NextTemplate basic
Introduction to the XML template format
For those already familiar with XML documents, the template structure is easy to read and intuitive.
The basic element is the opening tag <pdf> at the beginning of the document and the corresponding closing tag </pdf> at the end.
Within this element, other elements are inserted, some mandatory and some optional.
Overview of the XML structure by example
Main elements:
<pdf> The root container that wraps all PDF configuration settings
<default_page> (Optional) Default page settings. If not set, the default page is A4, vertical, with measurement units mm
<doc_info> (Optional) Document information (creator, author, title, subject, keywords)
<section> (At least one section must be included) A section can be linked to data that can be cycled through (for this reason it is important to specify the identifier parameter "id"). From one section you can call up the various contents that group together all the elements to be printed in the PDF.
<content> A content groups all the objects to be printed
Simple template example (element-based syntax)
It is possible to write XML code in a flexible way, using two different modes: "element-based syntax" as in the previous example or "attribute-based syntax" as in the following example.
Default page written using "attribute-based syntax"
The first example uses element-based syntax where each piece of information is represented as a separate child element. The second example uses attribute-based syntax where all the information is contained within attributes of a single self-closing element.
The choice between these two approaches is often a matter of design preference, readability requirements, or specific XML schema constraints. The element-based approach tends to be more verbose but can be easier to read and extend, while the attribute-based approach is more compact and concise. From a data processing perspective, both would yield identical results when parsed by an XML processor.
An XML element that contains only a single value (text or a number) and contains no other elements can be written more concisely using the "value" attribute to indicate its value. The example below shows how the title value can be set (either syntax is alternative and equivalent to the other).