Print layout syntax

Print layout example

<?xml version="1.0" encoding="utf-8"?>
<PrintLayout Name="My Printlayout" Remark="My Remark">
< PrinterResolution hDPI="300" vDPI="300">
< PrinterParameter>
< Parameters Name="XIJET_QUEUE_DEPTH" Value="2"/>
</ PrinterParameter>
< Canvas Height="38.1" Width="200">
< LoadFont FontNo="1" File="Arial_600x300_12_400_0.XFT" Rotation="0"/>
< LoadFont FontNo="2" File="USPSIMBStandard_600x300_16_500_0.XFT" Rotation="90"/>
< Image File="image.gif" hPos="50" vPos="30" Height="20" Width="30"/>
< Text FontNo="1" String="Hello" Top="50" Left="30" Bottom="70" Right="50" Align="Left" Reverse="0" Wrap="0" Mirror="0" BottomJustify="0"/>
< Text FontNo="2" Variable="SIx" Top="150" Left="310" Bottom="170" Right="150" Align="Center" Reverse="0" Wrap="0" Mirror="0" BottomJustify="0"/>
</ Canvas>
</ PrinterResolution>
</PrintLayout>

Minimal print layout

<?xml version="1.0" encoding="utf-8"?>
<PrintLayout Name="Empty" Remark="NoPrint">
<PrinterResolution hDPI="300" vDPI="300">
<Canvas Height="0" Width="0"/>
</PrinterResolution>
</PrintLayout>

Tags

The XML configuration file is structured as follows:

ElementAttributeCardinality
Optional / mandatory
Description
Valid values
<PrintLayout>1Root container element
NameMandatory, not emptyName of the print layout
Container element
RemarkOptionalComment on the print layout
<PrinterResolution>1 ...
N
for defining the printer resolution
Mandatory
hDPI
, fixed value "300"Horizontal resolution in DPI [dots per inch]
Only the resolution 300 DPI is supported!
vDPIMandatory, fixed value "300"Vertical resolution in DPI [dots per inch]
Only the resolution 300 DPI is supported!
<PrinterParameter>Optional, 0..1Container Element for printer-specific parameters
<Parameter>Optional, 0..NElement for printer-specific parameters
NameMandatory, name of the printer-specific parameter.
ValueMandatoryDepending on the parameter name
<Canvas>1Element for virtual drawing area.

. ....Ifisprinted.
All position specifications of the <Image> and <Text> elements refer to the top left corner of this canvas.
hPrintOffsetMandatoryHorizontal print offset in [mm] from the right letter edge, see dimensioning.
If no automatic print offset is switched on or the automatic print offset does not find a free area, it is printed at the position defined here
HeightMandatoryHeight of the drawing area in [mm], see
dimensioning
WidthMandatoryWidth of the drawing area in [mm], see dimensioning.
<LoadFont>0 ...NElement for font.
All fonts used by the <Text> elements must be loaded beforehand with <LoadFont>!
FontNrMandatory
Internal number of the font, this is referenced by the <Text> elements
FileMandatoryFile name of the font.
Font files must be in the internal XiJet format (XFT).
Rotation
Mandatory
Alignment/rotation of the font in degrees [ยบ].
Permitted values:
"0", "90", "180", "270"
<Image>0..NElement for images, images must be saved in Windows BMP format!
FileMandatoryFile name of the image
hPosMandatoryHorizontal position in [mm] of the image in the drawing area relative to the top left corner of the canvas
vPosMandatoryVertical position in [mm] of the image in the drawing area relative to the top left corner of the canvas.
HeightOptionalHeight of the image in [mm].
If defined, the image is printed up to a maximum of this height, the rest is cut off
If not defined, the entire image is printed
WidthOptionalWidth of the image in [mm]. If defined, thed image is printed up to a maximum of this width, the rest is cut off.
not defined, the entire image
<Text>0 ...
NElement for static or dynamic textThe fonts used must be loaded beforehand and are referenced via the "FontNr" attribute.
FontNrMandatoryReference to font loaded via <LoadFont>.
StringOptionalStatic text to be printed
VariableOptionalDynamic text to be printed.

The attribute defines the shipment attribute that is printed.
See print variables for permitted values.
Example:
- "UPOC": UPOC of the shipment
- "SIx": Sort info SIx of the shipment
TopMandatorypositioning/bounding box: Vertical position of the top left corner of the text field relative to the canvas [mm], see dimensioning.
dimensioning
LeftMandatorypositioning/bounding box:
Horizontal position of the upper left corner of the text field relative to the canvas [mm], see
.
positioning/BoundingBox
BottomMandatory
: Vertical position of the lower right corner of the text field relative to the canvas [mm].
RightMandatorypositioning/BoundingBox:
Horizontal position of the bottom right corner of the text field relative to the canvas [mm].
.
AlignOptionalOptional attribute, if not defined, "Left" is used as the default

Permitted values: "Left", "Center", "Right"
ReverseOptional0= normal, 1= reverse colors
Optional attribute
WrapOptional
, if not defined is used as default "0" (No Warp).
Permitted values: "0", "1"
0 = No wrapping, , when text reaches the edge of the bounding box the text is cplipped
1 = Wrap text.
When text reaches the edge of the bounding box that word is automatically moved to the next line.
ute, if not
MirrorOptionalOptional attrib
defined is used as default
"0" (Not mirror
)
.
Allowed values: "0", "1"
0 = Not mirror
1 = Mirror the resulting image about the center of the horizontal bounds.
.
BottomJustify
Optional
Optional attribute, if not defined is used as default "0" (No BottomJustify)

Permitted
values: "0", "1"
0 = No BottomJustify
1 = Lines of text will be bottom justified ('Bottom' is a relative term, as it relates to rotation of 0).
BarcodeTypeOptionalDefines whether the text is interpreted as a barcode.
Permitted values: "", "Interleaved2of5"

Dimensioning

The height of the printable area is fixed at 1.5 inches = 38 mm

.

To make full use of the print area, 38 is therefore a sensible value for <Canvas>.Height.

180 degree rotated text

The

following XML tags/attributes must be adapted for printing 180 degree rotated text:


Example:

<?xml version="1.0" encoding="utf-8"?>
<PrintLayout Name="180 degrees rotated" Remark="180 degrees rotated">


<PrinterResolution hDPI="300" vDPI="300">


<Canvas Height="38.1" Width="210">


<!-- 180 Grad Fonts -->
<LoadFont FontNr="1" File="Arial_300_12_400_0.XFT" Rotation="180"/>
<LoadFont FontNr="2" File="Arial_300_16_400_0.XFT" Rotation="180"/>
< !-- 180 degree texts -->
< Text FontNr="1" String="Test Bottom=12 Right=150" Top="0" Left="0" Bottom="12" Right="150" Align="Left" Reverse="0" Wrap="0" Mirror="0" BottomJustify="0"/>
< Text FontNr="1" String="Test Bottom=18 Right=100" Top="0" Left="0" Bottom="18" Right="100" Align="Left" Reverse="0" Wrap="0" Mirror="0" BottomJustify="0"/>
< Text FontNr="2" String="Test Bottom=30 Right=100" Top="0" Left="0" Bottom="30" Right="100" Align="Left" Reverse="0" Wrap="0" Mirror="0" BottomJustify="0"/>

</Canvas>


</PrinterResolution>
</PrintLayout>

See also:



CodX Software CodX Software AG
Sinserstrasse 47
6330 Cham
Switzerland
support
http://support.codx.ch
CxSpickel