Source Code Editing to Customize Advanced Templates

Important:

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.

Important:

For issues with NetSuite advanced templates, contact NetSuite Support.

For more detailed information about BFO elements and FreeMarker, see:

Related Topics

General Notices