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"/>
<
CxReport Guid="" Name="TheReport"/>
</ 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
RemarkOptionalComment on the print layout
<PrinterResolution>1 ...
NContainer element for defining the printer resolution
hDPIMandatory, 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.

All position specifications of the <Image> and <Text> elements refer to the top left-hand corner of this drawing area.
hPrintOffsetOptional, type "Float"
Default (if not defined) = "0.0"
Horizontal print offset in [mm] from the right-hand edge of the letter, 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.
HeightMandatory, type "Float"
Height of the drawing area in [mm], see dimensioning
. WidthMandatory, type "Float"
Width 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>!
FontNrMandatoryInternal number of the font, this is referenced by the <Text> elements.
FileMandatoryFile name of the font.
Font files must be in internal XiJet format (XFT).
RotationMandatoryAlignment/rotation of the font in angular 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.
If not defined, the entire image is printed.
<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.
LeftMandatorypositioning/bounding box:
Horizontal position of the upper left corner of the text field relative to the canvas [mm], see dimensioning.
BottomMandatorypositioning/BoundingBox: 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
WrapOptionalOptional attribute, 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.
MirrorOptionalOptional attribute
, if not 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.
BottomJustifyOptional 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"
<CxReport>Element for creating a label via CxReportThe CxReport identified via the Guid/Name attribute is executed and the label generated is printed as an image.
GuidOptional, identification of the CxReportused Guid of the CxReport used.
Has priority, if empty/not available, the Name attribute is used for identification.
NameOptional, identification of the CxReport usedName of the CxReport used in the "CxLetterScan Label" report profile.
Is only used if the Guid attribute is not available/empty.
hPosOptional, default: 0Horizontal position in [mm] of the label relative to the top left corner of the canvas.
vPosOptional, default: 0Vertical position in [mm] of the label relative to the top left corner of the canvas.

Dimension

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 adjusted 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>

Printing with CxReporting

The print can also be generated via CxReporting. A corresponding print layout must be defined for this, see example below.
The report generates a BMP file, which is then processed like an <Image> element.
The CxReports contained in a profile are loaded into the memory when the run is started; the report is executed for each consignment during the run.
The report is identified via the name or Guid of the report (Guid has priority). The name of the report is determined as follows:
Settings/General, tab "Configure reports", select checkbox "Show all reports", open profile "CxLetterScan Label", open report data via double-click, field "Report name" contains the name of the report.

Example:

<?xml version="1.0" encoding="utf-8"?>
<PrintLayout Name="Test print with CxReporting" Remark="Test print with CxReporting ">
<PrinterResolution hDPI="300" vDPI="300">
<Canvas Height="38.1" Width="200">
<CxReport

Name="88314"/>
</Canvas>
</PrinterResolution>
</PrintLayout>

See also::



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