Matthew
10/31/2023, 3:47 PMNElliott
10/31/2023, 3:50 PMMatthew
10/31/2023, 4:12 PM<?xml version="1.0"?><!DOCTYPE pdf PUBLIC "-//big.faceless.org//report" "report-1.1.dtd">
<pdf>
<head>
<link name="NotoSans" type="font" subtype="truetype" src="${nsfont.NotoSans_Regular}" src-bold="${nsfont.NotoSans_Bold}" src-italic="${nsfont.NotoSans_Italic}" src-bolditalic="${nsfont.NotoSans_BoldItalic}" bytes="2" />
<#if .locale == "zh_CN">
<link name="NotoSansCJKsc" type="font" subtype="opentype" src="${nsfont.NotoSansCJKsc_Regular}" src-bold="${nsfont.NotoSansCJKsc_Bold}" bytes="2" />
<#elseif .locale == "zh_TW">
<link name="NotoSansCJKtc" type="font" subtype="opentype" src="${nsfont.NotoSansCJKtc_Regular}" src-bold="${nsfont.NotoSansCJKtc_Bold}" bytes="2" />
<#elseif .locale == "ja_JP">
<link name="NotoSansCJKjp" type="font" subtype="opentype" src="${nsfont.NotoSansCJKjp_Regular}" src-bold="${nsfont.NotoSansCJKjp_Bold}" bytes="2" />
<#elseif .locale == "ko_KR">
<link name="NotoSansCJKkr" type="font" subtype="opentype" src="${nsfont.NotoSansCJKkr_Regular}" src-bold="${nsfont.NotoSansCJKkr_Bold}" bytes="2" />
<#elseif .locale == "th_TH">
<link name="NotoSansThai" type="font" subtype="opentype" src="${nsfont.NotoSansThai_Regular}" src-bold="${nsfont.NotoSansThai_Bold}" bytes="2" />
</#if>
<style type="text/css">table { font-size: 9pt; table-layout: fixed; width: 100%; }
th { font-weight: bold; font-size: 8pt; vertical-align: middle; padding: 5px 6px 3px; background-color: #e3e3e3; color: #333333; padding-bottom: 10px; padding-top: 10px; }
td { padding: 4px 6px; }
b { font-weight: bold; color: #333333; }
div { width: 50%; height: 50%; float: left; }
</style>
</head>
<body padding="0.5in 0.5in 0.5in 0.5in" size="Letter"> <!-- Letter A4-->
<table><#list results as result><#if result_index == 0>
</#if>
<tr>
<td><barcode bar-width="0.5" codetype="code128" showtext="true" value="${result.itemid}" /></td>
</tr>
<tr >
<td><barcode bar-width="0.5" codetype="code128" showtext="true" value="${result.custitem90}" /></td>
</tr>
<tr >
<td>Cartridge, Toner ${result.manufacturer}</td>
</tr>
<tr >
<td>${result.displayname}</td>
</tr>
<tr >
<td>${result.quantity}: Each</td>
</tr>
<tr >
<td>Stage Code: 0G4A2</td>
</tr>
<tr >
<td>Contract Number: ${result.pricelevel}</td>
</tr>
</#list>
</table>
</body>
</pdf>
Matthew
10/31/2023, 4:27 PMNElliott
10/31/2023, 4:59 PMPWN
10/31/2023, 5:11 PMNElliott
10/31/2023, 5:12 PMPWN
10/31/2023, 5:36 PMMatthew
10/31/2023, 9:40 PM<?xml version="1.0"?><!DOCTYPE pdf PUBLIC "-//big.faceless.org//report" "report-1.1.dtd">
<pdf>
<head>
<link name="NotoSans" type="font" subtype="truetype" src="${nsfont.NotoSans_Regular}" src-bold="${nsfont.NotoSans_Bold}" src-italic="${nsfont.NotoSans_Italic}" src-bolditalic="${nsfont.NotoSans_BoldItalic}" bytes="2" />
<#if .locale == "zh_CN">
<link name="NotoSansCJKsc" type="font" subtype="opentype" src="${nsfont.NotoSansCJKsc_Regular}" src-bold="${nsfont.NotoSansCJKsc_Bold}" bytes="2" />
<#elseif .locale == "zh_TW">
<link name="NotoSansCJKtc" type="font" subtype="opentype" src="${nsfont.NotoSansCJKtc_Regular}" src-bold="${nsfont.NotoSansCJKtc_Bold}" bytes="2" />
<#elseif .locale == "ja_JP">
<link name="NotoSansCJKjp" type="font" subtype="opentype" src="${nsfont.NotoSansCJKjp_Regular}" src-bold="${nsfont.NotoSansCJKjp_Bold}" bytes="2" />
<#elseif .locale == "ko_KR">
<link name="NotoSansCJKkr" type="font" subtype="opentype" src="${nsfont.NotoSansCJKkr_Regular}" src-bold="${nsfont.NotoSansCJKkr_Bold}" bytes="2" />
<#elseif .locale == "th_TH">
<link name="NotoSansThai" type="font" subtype="opentype" src="${nsfont.NotoSansThai_Regular}" src-bold="${nsfont.NotoSansThai_Bold}" bytes="2" />
</#if>
<style type="text/css">
body{ height:100%; margin: 0; padding: 0; }
html { height: 100%; margin: 0; padding: 0;}
</style>
</head>
<body padding="0.5in 0.5in 0.5in 0.5in" size="Letter">
<#list results as result>
<table border="1" cellpadding="1" cellspacing="1" style="width:50%; height:50%; float:left; ">
<tr><td>
<barcode bar-width="1" codetype="code128" showtext="true" value="${result.itemid}" />
</td></tr>
<tr><td>
<barcode bar-width="1" codetype="code128" showtext="true" value="${result.custitem90}" />
</td></tr>
<tr><td>
Cartridge, Toner ${result.manufacturer}
</td></tr>
<tr><td>
${result.displayname}
</td></tr>
<tr><td>
${result.quantity}: Each
</td></tr>
<tr><td>
Stage Code: 0G4A2
</td></tr>
<tr><td>
Contract Number: ${result.pricelevel}
</td></tr>
</table>
</#list>
</body>
</pdf>
David B
11/01/2023, 3:26 AM<#list ...>
and setting the height in inches.
Setting the height of the table as a percentage doesn't work. I think this is because there's no concept of the table's "parent container" having a height when the table tries to calculate what it's height should be.
As we know this is a Letter sized page with 0.5in
borders, we can set the table height to 5in
(letter = 11 inch tall).
I found that I didn't actually need to set the width. And I pulled the float out of the css style into it's own attribute. Don't need to set display="inline"
as that's implicitly set by float="left"
David B
11/01/2023, 3:27 AMheight:5in
, and the last is after wrapping it in the <#list results?chunk(4) ...>
David B
11/01/2023, 3:28 AMMatthew
11/01/2023, 5:16 PM