Source Code Editing to Customize Advanced Templates
When using advanced templates, follow the syntax and usage guidelines in the BFO and FreeMarker documentation. For version details, see Third-Party Products Used in Advanced Printing. For more information, see the BFO website, and FreeMarker website.
An advanced template that's used to print a PDF file is an XML document that uses syntax similar to HTML with FreeMarker and BFO (Big Faceless Organization) report generator elements included. For example:
<?xml version="1.0"?>
<!DOCTYPE pdf PUBLIC "-//big.faceless.org//report" "report-1.1.dtd">
<pdf>
<head>
</head>
<body>
Hello, World!
</body>
</pdf>
Line 1 of the template must declare the XML version, and Line 2 must specify the DOCTYPE. Line 3 includes the BFO <pdf> wrapping tag, not the <html> declaration you would see at the top of an HTML document.
Inside the <pdf> tag, the head and body elements contain standard HTML, and you can embed CSS2 elements. You can't use HTML5 declarations. The example displays the text "Hello, World!". For more information about the Big Faceless Report Generator, see BFO User Guide.
In XML, elements must always be closed. As shown in Line 8, <pdf> must always be matched by </pdf>, <b> by </b> and so on. For elements that have no content, like <br>, the closing tag is included in the element: <br />. Any attributes must have quotes around them, for example, <table width=”100%”>.
If a PDF template is used to print in HTML, the <pdf> tags are automatically converted to <html> when the document is printed.
For issues with NetSuite advanced templates, contact NetSuite Support.
For more detailed information about BFO elements and FreeMarker, see:
Related Topics
- Source Code Editing in the Template Editor
- Syntax for Advanced Template Fields
- Setting a Template to Use a Font Unavailable in NetSuite
- Adding Files to Advanced PDF Templates
- Languages for Printed Forms that Use Advanced Templates
- Adding Translated Content in Advanced Printouts
- Adding Striping to Line Items in Advanced Templates
- Adding Page Breaks to Tables
- Printing Subsidiary Logo on Advanced Templates
- Adding Apply Sublist to Check Templates
- Using FreeMarker to Work with Hidden Fields Used in Advanced Templates
- Adding Bar Codes in Advanced Templates
- XML Formatting in Advanced PDF/HTML Templates