Solution A sample Packing slip PDF having backorder field is given below
Category: Advanced PDF Templates
Advanced PDF Templates designs – PDF samples and xml codes
Remove the Gaps Between the Item Labels When Printing on Advanced PDF/HTML Template
There is a requirement to print Item Labels using Advanced PDF/HTML Templates, the labels are being printed by 3’s with large gaps in between. To minimize the gaps, an adjustment to the Item Label Template should be done. Solution Navigate to Customization > Forms > Advanced PDF/HTML Templates Click Edit beside the preferred Item Label PDF/HTML Template Top right corner: Toggle Source Code Remove the… Continue reading Remove the Gaps Between the Item Labels When Printing on Advanced PDF/HTML Template
Different ways to Concatenate Strings in free Marker
We can achieve this by using + operator OR without operator Without + operator <#assign s = “Hello ${user}!”> ${s} Using + operator <#assign s = “Hello ” + user + “!”> Note : Assume that user is “Big Joe”. In both cases the output will be Hello Big Joe!
To remove all intervening line breaks in a template
Use <@compress single_line=true>…</@compress> It aggressively removes indentations, empty lines and repeated spaces/tabs . Example: <@compress single_line=true> <#assign users = [{“name”:”Joe”, “hidden”:false}, {“name”:”James Bond”, “hidden”:true}, {“name”:”Julia”, “hidden”:false}]> List of users: <#list users as user> <#if !user.hidden> – ${user.name} </#if> </#list> That’s all. </#compress> OUTPUT List of users: – Joe – Julia That’s all.
Insert another FreeMarker template file into your template.
You can achieve this by using include. Syntax <#include path> or <#include path options> path: The path of the file to include; an expression that evaluates to a string. (With other words, it doesn’t have to be a fixed string, it can also be something like, for example, profile.baseDir + “/menu.ftl”.). Example: Assume /common/copyright.ftl contains: Copyright… Continue reading Insert another FreeMarker template file into your template.
Resolve Error: “Error Parsing XML: The entity name must immediately follow the ‘&’ in the entity reference”
This issue is normally seen in PDF and XML file of the pdf template which are rendered through script. This happens when our data contains ‘&’. ‘&’ are not supported in pdf and xml. Instead need to use ‘&’ Solution This can be resolved by using replace() function Example: If you are updating Advanced PDF… Continue reading Resolve Error: “Error Parsing XML: The entity name must immediately follow the ‘&’ in the entity reference”
Break Long Descriptions Using Advanced PDF/Html
There are scenarios when an Item Description on an Advanced PDF Template is too long which causes the Item row to be printed on the next page. This article shows how to split the description to print on 2 pages and display it in sub-paragraphs in multiple rows.
Fix content as footer data but show only last page in Customer Statement print
Change the page size on advanced PDF Template
There will be scenarios that smaller page size for taking the print. For example: PDF like item label, shipping label can have smaller pager size. Solutions Navigate to Customization > Forms > Advanced PDF/HTML Templates Preferred Advanced PDF/HTML Template: Click Edit Top Right Corner: Toggle Source Code Source Code: Locate the code below from the PDF source code<body header=”nlheader” header-height=”10%” footer=”nlfooter” footer-height=”10pt”padding=”0.5in 0.5in 0.5in 0.5in”… Continue reading Change the page size on advanced PDF Template
How to use a checkbox as a Condition on Advanced PDF/HTML Templates
How to use a checkbox as a Condition on Advanced PDF/HTML Templates