<pdf>

	<version>1.0.0</version>
	<title>PDF Template Demo - Product labels</title>
	<date>2026-10-05</date>
	<note>Shelf labels on A4 sheets, 3 x 8 labels 63.5 x 38.1 mm (Avery L7160 layout): section with columns, data read from a CSV file (DataProviderCSV)</note>

	<default_page>
		<orientation>P</orientation>
		<unit>mm</unit>
		<format>A4</format>
	</default_page>

	<doc_info>
		<creator>Alien Project</creator>
		<author>#MBR</author>
		<title>PDF Product Labels Demo</title>
		<subject>Copyright (C) 2026 - Alien Project</subject>
		<keywords>labels, shelf labels, price tags, barcode, qr code, csv, pdf, example</keywords>
	</doc_info>

	<!-- Section without data provider: printed again for each new sheet of the nested "lab" section -->
	<section id="sheet">
		<page format="A4" orientation="P"/>

		<!-- For debug, set BORDER=1 to check the box sizes -->
		<setvar name="BORDER" value="0"/>
		<!-- Label outline: 1 = print it (preview on plain paper), 0 = hide it (pre-cut label sheets) -->
		<setvar name="OUTLINE" value="1"/>
		<setvar name="COLOR_TEXT" value="1d232b"/>
		<setvar name="COLOR_GREY" value="6b7682"/>
		<setvar name="COLOR_LINE" value="d5dbe1"/>
		<setvar name="COLOR_OFFER" value="d62839"/>
		<setvar name="COLOR_WHITE" value="ffffff"/>

		<print_content>sheet_header</print_content>

		<!-- 3 columns x 8 rows = 24 labels per sheet. Label pitch: 66 mm (columns), 38.1 mm (rows) -->
		<section id="lab" y_start="15.15" row_height="38.1" rows_count="8" columns="3" column_width="66">
			<print_content>label</print_content>
		</section>
	</section>

	<section id="finalize">
		<output>
			<dest>I</dest>
			<name>product_labels.pdf</name>
			<isUTF8>true</isUTF8>
		</output>
	</section>

	<!-- ********************************** -->

	<content id="sheet_header">
		<fill type="N"/>
		<box x="7.2" y="5" width="130" height="5" border="{BORDER}" horizalign="Left" vertalign="Center">
			<text>{STORE_NAME}  ·  {SHEET_INFO}</text>
			<font family="Helvetica" style="N" size="6.5" color="a3adb8"/>
		</box>
		<box x="137" y="5" width="65.6" height="5" border="{BORDER}" horizalign="Right" vertalign="Center">
			<text>Sheet {PAGEINDEX} / {PAGECOUNT}</text>
			<font family="Helvetica" style="N" size="6.5" color="a3adb8"/>
		</box>
	</content>

	<!-- ********************************** -->

	<!-- One label (63.5 x 38.1 mm): the coordinates are those of the first label (top left), x = 7.2, y = 15.15 -->
	<content id="label">
		<!-- Label outline -->
		<rectangle x1="7.2" y1="15.15" x2="70.7" y2="53.25" radius="2.5" border="1111" printif="{OUTLINE}=1">
			<linestyle width="0.2" color="{COLOR_LINE}"/>
			<fill type="N"/>
		</rectangle>
		<!-- Category color stripe on the left -->
		<rectangle x1="7.2" y1="15.15" x2="9.2" y2="53.25" radius="1" border="1001">
			<linestyle width="0"/>
			<fill type="S" color="{lab.color}"/>
		</rectangle>
		<fill type="N"/>

		<!-- Category, product name (up to 2 lines) and brand -->
		<box x="11.5" y="17.5" width="43" height="3.5" border="{BORDER}" horizalign="Left" vertalign="Center">
			<text>{lab.category}</text>
			<font family="Helvetica" style="B" size="5.5" color="{lab.color}"/>
		</box>
		<box x="11.5" y="21" width="44" height="8" border="{BORDER}" horizalign="Left" vertalign="Top">
			<text>{lab.name}</text>
			<font family="Helvetica" style="B" size="8.5" color="{COLOR_TEXT}"/>
		</box>
		<box x="11.5" y="29.2" width="44" height="3.5" border="{BORDER}" horizalign="Left" vertalign="Center">
			<text>{lab.brand}  ·  {lab.size}</text>
			<font family="Helvetica" style="N" size="6" color="{COLOR_GREY}"/>
		</box>

		<!-- QR code with the product page -->
		<barcode x="57" y="17.2" width="11.5" height="11.5" type="QRCODE,M" value="https://shop.example.com/p/{lab.sku}" border="0" color="{COLOR_TEXT}"/>

		<!-- Separator -->
		<line x="11.5" y="34" width="57" height="1">
			<orientation>HorizontallyTop</orientation>
			<linestyle width="0.2" color="{COLOR_LINE}"/>
		</line>

		<!-- EAN-13 barcode (the digits are printed below the bars) -->
		<barcode x="10.5" y="35.5" width="29" height="16" type="EAN13" value="{lab.ean}" align="L" border="0" color="{COLOR_TEXT}"/>

		<!-- Offer badge (only when the "offer" field has a value, eg. -20%) -->
		<rectangle x1="45.5" y1="35.6" x2="68.5" y2="39.6" radius="1" border="1111" printif="{lab.offer}">
			<linestyle width="0"/>
			<fill type="S" color="{COLOR_OFFER}"/>
		</rectangle>
		<fill type="N"/>
		<box x="45.5" y="35.6" width="23" height="4" border="{BORDER}" horizalign="Center" vertalign="Center" printif="{lab.offer}">
			<text>OFFER {lab.offer}</text>
			<font family="Helvetica" style="B" size="6" color="{COLOR_WHITE}"/>
		</box>

		<!-- Price: dark for regular items, red for offers ("x{lab.offer}=x" is true when the offer field is empty) -->
		<box x="40" y="39.5" width="29" height="8.5" border="{BORDER}" horizalign="Right" vertalign="Center" printif="x{lab.offer}=x">
			<text>${lab.price}</text>
			<font family="Helvetica" style="B" size="19" color="{COLOR_TEXT}"/>
		</box>
		<box x="40" y="39.5" width="29" height="8.5" border="{BORDER}" horizalign="Right" vertalign="Center" printif="{lab.offer}">
			<text>${lab.price}</text>
			<font family="Helvetica" style="B" size="19" color="{COLOR_OFFER}"/>
		</box>

		<!-- Unit price and regular price of the offers -->
		<box x="40" y="48" width="29" height="3.5" border="{BORDER}" horizalign="Right" vertalign="Center">
			<text>${lab.unitPrice} / {lab.unit}</text>
			<font family="Helvetica" style="N" size="6" color="{COLOR_GREY}"/>
		</box>
		<box x="40" y="48" width="14" height="3.5" border="{BORDER}" horizalign="Left" vertalign="Center" printif="{lab.offer}">
			<text>was ${lab.oldPrice}</text>
			<font family="Helvetica" style="I" size="6" color="{COLOR_OFFER}"/>
		</box>
	</content>

</pdf>
