You are on page 1of 21

6 Design Input Modules | 577

6.3 Layout Module

Variable Formatted Flows


In this section: See also:

Comparison of Variable Formatted and Line Data Formatting field converter


Overflowable Variable Formatted Flows
Syntax
Commands Overview
Commands Reference
Examples of Variable Formatted Tagged
Data

Variable formatted flow has its content and formatting controlled by a variable.

The assigned variable will contain a combination of:

● commands (similar to tags used in HTML or XML) and

● the content (the text to be presented)

To use variable formatting:

1. Select the flow you want to control.

2. From the Flows Layout Properties, select Variable formatted or Overflowable variable formatted as the flow type.

3. Assign a (string) variable to the flow that will control the formatting.

Comparison of Variable Formatted and Overflowable Variable Formatted Flows


Variable formatted flow cannot flow from page to page; for that purpose you can select the overflowable variable
formatted flow.

It is recommended to use the overflowable variable formatted flow for relatively few combinations of different flow contents
because the whole flow content is kept in memory, which means that:

● for more complex flows you may run out of memory before the job is printed

● on the other hand, it can be faster than Variable formatted flow in case of relatively few combinations of flow
contents

Both overflowable variable formatted and variable formatted flows have the following Layout Properties window:

Options Description

Type Selected Variable Formatted.

Visible flow width Defines the width of the visible space of the flow in the Layout Area. This option is general for all
types of flows; see the detailed description in Flow Layout Properties section.
6 Design Input Modules | 578
6.3 Layout Module

Lock for Docx Sets the lock for editing the flow content in the produced DOCX file. This option is general for all types
of flows; see the detailed description in Flow Layout Properties section.

Variable Allows you to select a variable controlling the content and formatting. In other words, the variable delivers
text enriched with formatting tags.

Inherit para/text styles If this option is not checked or the variable flow is the first flow in flow area, Normal style is
used.

If checked, the paragraph and text style can be inherited from the previous flow if there is any. For more details see
also Paragraph Styles section.

Syntax
The content and formatting of the flow is defined by a markup language similar to HTML or XML. Commands (tags,
markups) are enclosed in angle brackets (e.g. <b> for bold) and they are intermixed with the text content.

EXAMPLE Example: flow defined as

Hello <b>world</b>!

will be printed as

Hello world!

NOTE

● Command and parameter names are case sensitive and use lower case letters. The only exception is the
pageIndex parameter of the <image> command.

● Special characters, like angle brackets, have to be defined with special keywords:

○ &amp; for ampersand &

○ &lt; for left angle bracket <

○ &gt; for right angle bracket >

○ &apos; for apostrophe '

○ &quot; for double quotes "

● Boolean parameters can have the following values: 0, 1, F, T, FALSE, TRUE, N, Y, NO, YES. They
are not case sensitive.

See Commands Overview for the list of available commands and the Commands Reference section for a comprehensive
description of commands and their parameters.

Commands Overview

Paragraphs

● <p> – Starts a new paragraph


6 Design Input Modules | 579
6.3 Layout Module

Text styles

● <t> – Changes the active text style

● <font> – Changes the active font

● <b> – Applies bold face

● <i> – Applies italics

● <u> – Underlines the text

● <s>, <strike> – Uses strike-through

● <sup> – Uses superscript

● <sub> – Uses subscript

● <smallcap> – Uses small caps

Tables

● <table> – Creates a table

● <row> – Creates a row

● <cell> – Creates a cell

● <headerfooter> – Creates header and footer rowsets

● <rowset> – Creates a rowset

Other objects

● <image> – Inserts an image object

● <flowobject> – Inserts an element

● <flow> – Inserts another flow

● <variable> – Inserts a variable

● <br> – Inserts a line-break

Conditionals

● <if> – Conditionally selects the flow content

● <else> – Conditionally selects the flow content

● <elseif> – Conditionally selects the flow content

EXAMPLE Using Conditional Flow


The following example explains the use of conditional flows:

<if inline="SYS.PageIndex==0">First condition


<elseif inline="SystemVariable.PageIndex==1">Second condition
<else>Third condition</if>common text
6 Design Input Modules | 580
6.3 Layout Module

This is an example of using an inline condition. If the page index equals zero, "First condition common text" will
be printed. If the page index equals one, "Second condition common text" will be printed. Otherwise "Third
condition common text" will be printed.

NOTE Code cannot be written as follows:

<if inline="[condition]"><fontsize=10pt>
<else><font size=12pt><var DATA.Value>

because <var DATA.Value> must come after each <if> or <else> statement. Thus the correct code is:

<if inline="[condition]"><fontsize=10pt><var DATA.Value>


<else><font size=12pt><var DATA.Value>

Commands Reference
<p>
This command starts a new paragraph and defines its properties. See also Paragraph Style Layout Properties panel.

EXAMPLE

● You can use an existing paragraph style:

<p name=HeaderParaStyle>Hello world!

● You can use an existing paragraph style and override some attributes:

<p name=MyStyle leftindent=10mm>Hello world!

● You can override the previous paragraph style:

<p ignoreemptylines=true>Hello world!

Parameters

name (node name with a path)

The name of the paragraph style that will be used for this paragraph, e.g. MyParaStyle1 or ParaFamily1.Style2.

usedefaultts (bool)

To be used in combination with the name parameter. If set to YES, the default text style of the paragraph style is used.
Otherwise, the text style of the previous paragraph is kept.

alignment (keyword)

Text alignment (optional). The permitted values are left, right, center, justifyleft, justifyright, justifycenter,
justifyblock.

leftindent (double with unit specified)


6 Design Input Modules | 581
6.3 Layout Module

Determines the space on the left side of the paragraph. This setting applies to all lines of the paragraph.

rightindent (double with unit specified)

Determines the space on the right side of the paragraph. This setting applies to all lines of the paragraph.

firstlineleftindent (double with unit specified)

Determines the space on the left side of the first line of the paragraph.

spacebeforeonfirst (bool)

Determines, if the value set in the spacebefore parameter will be applied when the current paragraph is the first
paragraph in a flow area. When set to the default setting NO, the paragraph always starts at the top of the flow area
regardless of the setting made by the spacebefore parameter. When YES is set, the value set by the spacebefore
parameter is always applied.

NOTE When a paragraph overflows into a new flow area, this setting will also determine the position of
the first line of the paragraph in the new flow area.

spacebefore (double with unit specified)

Sets the vertical space before the paragraph.

spaceafter (double with unit specified)

Sets the vertical space after the paragraph.

linespacingtype (keyword)

Sets the space between the lines of the text. Permitted values are additional, atleast, exact, multipleof.

linespacing (double with unit specified)

Specifies the value for line spacing (see the linespacingtype parameter above).

ignoreemptylines (bool)

Determines whether empty lines will be printed or not.

flowbreakbefore (keyword)

Sets the position of the paragraph to which it is applied. Permitted values are no, flowarea, page, column.

flowbreakafter (keyword)

Sets the position of the following paragraph. Permitted values are no, flowarea, page, column.

keeplinestogether (bool)

Determines whether a paragraph may overflow from one flow area to another.

keepwithnextparagraph (bool)

If set to YES, the last line of the paragraph will always be displayed in the same flow area as the first line of the fol-
lowing paragraph.

donotwrap (bool)
6 Design Input Modules | 582
6.3 Layout Module

Determines whether or not the text will be wrapped. If set to YES, text will not wrap when reaching the border of
the flow area in which it is contained.

border (node with path)

The name of the border style to be used for this paragraph, e.g. MyBorderStyle or BorderFamily1.Style4

connectborders (bool)

Determines whether borders will be connected.

borderwithlinegap (bool)

Determines if a space between lines (line gap) will be used.

defaulttab (double with unit specified)

Sets the default distance between tabs.

hyphenate (bool)

Sets whether hyphenation within the text of the paragraph will or will not be permitted.

hyphminleft (int)

Sets the minimum number of characters that will remain before the hyphen.

hyphminright (int)

Sets the minimum number of characters you want to carry over to a new line after the hyphen.

hyphmaxconsecutive (int)

Defines the maximum number of consecutively following lines ending with hyphens.

<t>
This command applies a text style on the text content. See also Text Style Layout Properties panel.

EXAMPLE

● You can use an existing text style:

<t name=HeaderTextStyle>Hello world!

● You can use an existing text style and override some attributes:

<t name=MyStyle fontsize=14>Hello world!

● You can override the previous text style:

<t fill=RedFill>Hello world!


6 Design Input Modules | 583
6.3 Layout Module

Parameters

affectsupersubscriptstrikethrough (bool)

If set to YES, superscript/subscript will be struck through independently from the remaining text (discontinuous un-
derline). If set to NO, superscript/subscript will be will be struck through as if it was a normal text (continuous underline).

affectsupersubscriptunderline (bool)

If set to YES, superscript/subscript will be underlined independently from the remaining text (discontinuous underline).
If set to NO, superscript/subscript will be will be underlined as if it was a normal text (continuous underline).

afpcodec (string)

Name of the codec for the AFP font.

afpcodepage (location)

Location of an AFP code page for the AFP font.

baselineshift (double with unit)

Determines the space between the characters and the baseline.

bold (bool)

If set to YES, the text will be bold.

border (node with path)

The name of the border style that will be used for the text, e.g. MyBorderStyle or BorderFamily1.Style4

borderwithlinegap (bool)

Determines whether the border will be extended slightly below the text.

cap (keyword)

Controls the corners of the outline when two line segments intersect. Permitted values are butt, round, square.

color (RGB)

The fill color for glyphs.

connectborders (bool)

Determines whether the borders will be connected.

fill (fill style with path)

The name of the fill style that will be used for the text, e.g. MyFillStyle or MyFillFamily.Style2

fontlocation (location)

Location of the font file.

fontname (font name with path)

Name of the font you wish to use.

subfont (font name with path)


6 Design Input Modules | 584
6.3 Layout Module

Name of the subfont you wish to use, e.g. Arial Black.

fontsize (double with unit)

The size of the font you wish to use, e.g. 12.0pt.

horizontalscale (percent)

Horizontally scales the text by the specified percentage, e.g. <t horizontalscale=150>Text

intercharspacing (double with unit)

Determines the space between individual characters.

italic (bool)

If set to YES, the text will be italicized.

join (keyword)

Controls the shape of the intersection points of the outline. Permitted values are mitter, round, bevel.

kerning (bool)

If set to YES, kerning is applied to the text style.

language (string)

Determines the alphabet/characters that will be used in the document. This needs to be set in order to hyphenate
the text.

miter (double)

Controls the effect of the Join setting when the Miter outline join is selected.

name (text style name with a path)

The name of the text style that will be used, e.g. MyTextStyle or MyTextFamily.Style2.

outline (fill style with path)

The name of the fill style that will be used for outlines of this text, e.g. MyFillStyle or MyFillFamily.Style2

outlinewidth (double with unit)

Determines the width of the outline of the text, if the fill color is different from the outline color.

smallcap (bool)

If set to YES, the text will be written in small caps. Small caps means that lowercase letters are capitalized, but are
slightly smaller than uppercase letters.

smallcapsize (percent)

Sets the small cap size.

strikethrough (bool)

If set to YES, the text will be struck through.

strikethroughoffset (percent)
6 Design Input Modules | 585
6.3 Layout Module

Sets the strikethrough offset from the baseline.

strikethroughwidth (percent)

Sets the strikethrough width.

subscript (bool)

If set to YES, the text will be written as subscript.

subscriptoffset (percent)

Sets the subscript offset from the baseline.

superscript (bool)

If set to YES, the text will be written as superscript.

superscriptoffset (percent)

Sets the superscript offset from the baseline.

supersubscriptsize (percent)

Sets the size of superscript/subscript.

underline (bool)

If set to YES, the text will be underlined.

underlineoffset (percent)

Sets the underline offset from the baseline.

underlinewidth (percent)

Sets the underline width.

urltarget (string)

Sets an URL link, which will be active in the output files in PDF, TNO, HTML, and HTML Simple format.

NOTE For HTML and HTML Simple outputs the URL link has to contain the http:// prefix, otherwise the link
may not work.

<font>
This command controls which font will be used for the text content. It overrides font settings from the active text style.

EXAMPLE

Normal and <font name=Arial>Arial</font>.


<font fontlocation=font.240 afpcodepage=d:\\fonts\font240cp afpcodec="UTF-8">AFP font 240
6 Design Input Modules | 586
6.3 Layout Module

Parameters

name (node name with a path)

The name of the font that will be used, e.g. Arial or MyFonts.BoldFont.

fontlocation (location)

Location of the font file.

afpcodec (string)

Name of the codec for the AFP font.

afpcodepage (location)

Location of an AFP code page for the AFP font.

size (double with unit)

The size of the font you wish to use, e.g. 12.0pt.

color (RGB)

The fill color for glyphs.

<b>
This command overrides the active text style and turns on the Bold option.

EXAMPLE

Normal and <b>bold</b>.

<i>
This command overrides the active text style and turns on the Italic option.

<u>
This command overrides the active text style and turns on the Underline option.

<s>, <strike>
These commands overrides the active text style and turns on the Strikethrough option.

<sup>
This command overrides the active text style and turns on the Superscript option.

<sub>
This command overrides the active text style and turns on the Subscript option.

<smallcap>
This command overrides the active text style and turns on the Smallcap option.
6 Design Input Modules | 587
6.3 Layout Module

<if>
This command begins a conditional block, defines the condition and also the content, which will be used, if the condition
is true.

EXAMPLE

<if inline="SYS.PageIndex==0">Title Page</if>

Parameters

cond (node with path)

Name of the boolean variable which will be evaluated as the condition, e.g. SYS.Overflow

inline (string)

String with a script that evaluates to boolean condition, e.g. SYS.PageIndex==0.

base (node with path)

Base context which will be used for evaluating inline condition.

flow (node with path)

Defines a flow, the content of which will be inserted into the active flow, if the condition is true.

EXAMPLE

<if inline="SYS.PageIndex==0" flow="TitlePageFlow">

<else>
This command contains a conditional block and defines the content, which will be used, if the condition was not true.

EXAMPLE

<else>Print something else.

Parameters

flow (node with path)

Defines a flow, the content of which will be inserted into the active flow.

EXAMPLE

<else flow="PageFlow">
6 Design Input Modules | 588
6.3 Layout Module

<elseif>
This command is a shortcut for <else><if>.

EXAMPLE

<elseif inline="SYS.PageIndex==1">The Second Page</if>

Parameters

cond (node with path)

Name of the boolean variable which will be evaluated as the condition, e.g. SYS.Overflow

inline (string)

String with a script that evaluates to boolean condition, e.g. SYS.PageIndex==0.

flow (node with path)

Defines a flow, the content of which will be inserted into the active flow, if the condition is true.

EXAMPLE

<elseif inline="SYS.PageIndex==1" flow="SecondPageFlow">

<table>
This command inserts a table into the flow. See also Tables Layout Properties.

EXAMPLE

● You can use an existing table:

<table name=Table1>

● You can create a new table:

<table><row name=RowSet1><row name=RowSet2>

Parameters

name (node with path)

Name of an existing table that will be included.

border (node with path)

Name of the specific border style that you want to apply on the selected table.

alignment (keyword)
6 Design Input Modules | 589
6.3 Layout Module

Selects the horizontal alignment of the table within the flow area where it is inserted. Permitted values are left,
right, center.

NOTE The effect of this setting is only visible when you set percentwidth to a value below 100%.

percentwidth (double)

The relationship between the width of the table and the width of the flow area in which it is inserted.

minwidth (double with unit)

Sets the minimum width of the table. This will override the percent width, if there is a conflict.

horizontalspacing (double with unit)

Sets the spacing between columns.

verticalspacing (double with unit)

Sets the spacing between rows.

spaceleft (double with unit)

Sets the minimum space between the table and the left border of the flow area.

spacetop (double with unit)

Sets the minimum space between the table and the top border of the flow area.

spaceright (double with unit)

Sets the minimum space between the table and the right border of the flow area.

spacebottom (double with unit)

Sets the minimum space between the table and the bottom border of the flow area.

percentcolumnwidths (list of doubles)

Sets the size ratio of the columns in the table. When a table is created, all columns have the same width, so the values
will always be the same for each column. Default settings are calculated in the following way: 1 is divided by the
number of columns.

EXAMPLE

<table percentcolumnwidths="0.4,0.2,0.4"><row><cell>new cell 1<cell>new cell 2<cell>new


cell 3

mincolumnwidths (list of doubles with units)

Sets the minimum widths of the columns. These will override the percent widths if there is a conflict. The default
setting is 1mm.
6 Design Input Modules | 590
6.3 Layout Module

EXAMPLE

<table mincolumnwidths="10mm,12.0cm"><row><cell>new cell 1<cell>new cell 2

<row>
This command inserts a row into the table. See also Row Set Layout Properties Orphan/Widow Tab.

EXAMPLE

● You can use an existing row:

<table><row name=Row1>

● You can create a new row:

<table><row><cell name=RowSet1.Cell1><cell name=RowSet1.Cell2>

Parameters

name (node with path)

Name of an existing row that will be included.

keepwithprevious (node with path)

Name of the variable which controls whether the row set is kept with the previous one, i.e. these row sets are not
separated.

keepwithnext (node with path)

Name of the variable which controls whether the row set is kept with the following one, i.e. these row sets are not
separated.

breakbefore (node with path)

Name of the variable which controls whether the table is broken (i.e. continues in the next flow area) before the se-
lected row set.

breakafter (node with path)

Name of the variable which controls whether the table is broken (i.e. continues in the next flow area) after the selected
row set.

<cell>
This command inserts a cell into the row. See also Cells.
6 Design Input Modules | 591
6.3 Layout Module

EXAMPLE

● You can use an existing cell:

<table><row><cell name=Row1>

● You can create a new cell:

<table><row><cell alignment=center border=BorderStyle>

Parameters

name (node with path)

Name of an existing cell that will be included.

border (node with path)

Name of the specific border style that you want to apply to the cell.

alignment (keyword)

Selects the vertical alignment of the cell content. Permitted values are top, bottom, center.

minwidth (double with unit)

Sets the minimum width of the cell. This will override the percent width if there is a conflict.

fixedheight (double with unit)

Forces a constant height for the cell. Use this option to increase the speed of table processing.

minheight (double with unit)

Sets the minimum height of the cell.

maxheight (double with unit)

Sets the maximum height of the cell.

spanleft (bool)

Select this option to merge this cell with the cell to the left.

spanup (bool)

Select this option to merge this cell with the cell above.

alwaysprocess (bool)

Allows you to determine whether or not will the cell be formatted for wrapping text. If the text in the cell will not
wrap, it is recommended to leave the default setting NO for optimal production speed.

flowtonextpage (bool)

When set, the content of the cell will be allowed to overflow to another flow area.
6 Design Input Modules | 592
6.3 Layout Module

<headerfooter>
This command allows you to create complex tables with header and footer rows.

EXAMPLE

<table>
<headerfooter><rowset type=header><row><cell>header
<rowset type=body><row><cell>body

<rowset>
This command allows you to create a set of rows (e.g. header or footer).

EXAMPLE

<table>
<headerfooter><rowset type=header><row><cell>header
<rowset type=body><row><cell>body

Parameters

type (keyword)

Sets the type of the rowset; permitted values are header, firstheader, contheader, body, contfooter,
lastfooter, footer.

<image>
This command inserts an image into the flow.

EXAMPLE

● You can use an existing image:

<image name=Image1>

● You can create a new image:

<image path="c:/image.png">

Parameters

name (node with path)

Name of an existing image that will be included.

path (string)

Path and filename of the image to include.

pageIndex (int)
6 Design Input Modules | 593
6.3 Layout Module

Selects the page of the image that you want to be shown. This is intended for multi page images, such as PDF docu-
ments.

colortype (keyword)

Permitted values: blackandwhite, grayscale, rgb, cmyk.

dpi (double or a pair of doubles)

Sets the image resolution, e.g. dpi=300 or dpi=600,300

size (double or a pair of doubles with unit)

Sets the size of the image, e.g. size="10cm,5cm" or size="0.1m".

native (Boolean)

Enables native loading if set to true, e.g. <image path=ImagePath native=true>.

nativeInOverlay (Boolean)

Creates a separate overlay for the image to be processed in (if set to true), e.g. <image path="MyImage.pdf" nat-
iveInOverlay=true>.

This also enables native loading of the image, i.e. you don't need to specify the native parameter.

variable (node with path)

Sets a variable that controls the variable image, e.g. variable=Customers.Value.Id.

TIP If loaded natively, you can use an image file with its own variables, in the same way as if the Use dynamic
variables option of the Image Layout Properties panel was applied. This feature may be of use, e.g. if you insert
a PDF file containing variables.

To do so, use the following script: <image variable=ImageName dynamic=true>, where the ImageName
variable contains the path to the image file.

<flowobject>
This command inserts an element into the flow.

EXAMPLE

<flowobject name="Element1">

Parameters

name (node with path)

Name of an element that will be included, e.g. Element1 or MyElemFamily.PictureElement.

<flow>
This command inserts a flow into the current flow.
6 Design Input Modules | 594
6.3 Layout Module

EXAMPLE

<flow name="Flow1">

Parameters

name (node with path)

Name of a flow that will be included, e.g. Flow1 or MyFlowFamily.BottomLineFlow.

location (string)

Path to the flow to include.

EXAMPLE

<flow name="Flow1" location="c:/workflow1.wfd">

<variable>
This command inserts the content of a variable into the flow.

EXAMPLE

Hello <var name="Customers.Value.Title"> <var name="Customers.Value.Surname>"!

<br>
This command inserts a line break into the flow.

EXAMPLE

Line1<br>Line2

Examples of Variable Formatted Tagged Data

Simple text

This is a variable formatted flow.

Returns the result:

This is a variable formatted flow.


6 Design Input Modules | 595
6.3 Layout Module

Bold, italic, underline

This is normal. <b>This is bold <i>This is bold


italic</b> This is italic. <u>This is underlined italic.

Returns the result:

Color changes

This is black. <font color=#FF0000>This is red. <font color=#0000FF>This is blue.

Returns the result:

Font changes

This is normal. <font name=Impact size=12>This is Impact font, size 12

Returns the result:

Paragraph styles

This is first paragraph style.


<p>This is second paragraph style.
<p name=MyParaStyle>This is third existing paragraph style.
<p firstlineleftindent=10mm>This is the fourth paragraph with first line left indent.

Returns the result:

Text style

This is normal.
<t fill=RedFill border=BlueBorderStyle>This is another text style.
<t name=MyTextStyle>This is an existing text style
6 Design Input Modules | 596
6.3 Layout Module

Returns the result:

Table

<table><row><cell>aaa<cell>bbb<row><cell>ccc<cell>ddd

Returns the result:

Table

<table>
<row> <cell border=TableBorder>aaa<cell border=TableBorder>bbb
<row> <cell border=TableBorder>
<table>
<row><cell>xxx<cell>yyy
<row><cell>zzz
</table>
<cell border=TableBorder>ddd

Returns the result:

Variable formatted flow

We invite you, as one of our most honored customers,


dear <b> <var name=Records.Value.ADDRESS> <var name=Records.Value.FIRSTNAME>
<var name=Records.Value.NAME></b>, to join us on a special event in the Swiss Mountains,
<b> free of any cost for you.</b> This will become an unforgettable....

Returns the result:

We invite you, as one of our most honored customers, dear Mr. David Smith, to join us on a special event in the
Swiss Mountains, free of any cost for you. This will become an unforgettable...

Conditional flow

<if cond=SystemVariable.True>This text will be printed


<else>non printable text.
6 Design Input Modules | 597
6.3 Layout Module

Returns the result (if the condition "True" is met ):

This text will be printed

Conditional flow

<if inline="SYS.PageIndex==0">First condition


<elseif inline="SystemVariable.PageIndex==1">Second condition
<else>Third condition</if> common text

Returns the result (if the condition "PageIndex equals 0" is met ):

First condition common text

Special characters

This is &lt;inside greater than, less than signs&gt; and <b>it works</b> like this.

Returns the result:

This is <inside greater than, less than signs> and it works like this.

Language Flows and Texts


See also:

Flows
Template Merger Module

Language flows and Language texts are for creating versions documents or electronic messages in different languages,
allowing for switches to be made between prepared translations of a document's content. The language that is to be
used can be determined by any variable that is suitable for this purpose, e.g. a country code from an address that is read
from an input data file.

EXAMPLE The below screenshot represents a new flow area which comprises Flow 1 with some text content.

After converting the flow to a language flow, the user added two new languages included it the data file - FR for
French and ES for Spanish. Flow 1 which is selected by language now contains three simple flows: Flow 1_ for

You might also like