BFO Elements in Advanced Templates
BFO (Big Faceless Organization) is a Java application that converts documents written in XML to PDF. BFO is used in NetSuite. For version details, see Third-Party Products Used in Advanced Printing. The following sections describe some commonly-used BFO elements.
Page Numbers
The most-commonly used BFO elements in PDF templates are page number and total pages. The <pagenumber /> and <totalpages /> tags insert the current page number and total number of pages. Because these values are known at the last part of rendering the page, you can't use them as values in FreeMarker declarations.
Headers, Footers and Background Macros
You can use BFO functionality to define macros to repeat pieces of HTML code on every page. You can define each macro in the head part of the template inside the <macrolist> tag. To apply the macro, you reference it in the <body> tag definition. You can't create multiple headers for a template. Also, you must declare a height for header and footer macros or they won't be applied. See the following example.
<?xml version="1.0"?>
<!DOCTYPE pdf PUBLIC "-//big.faceless.org//report" "report-1.1.dtd">
<pdf>
<head>
...
<macrolist> <!-- Definition of macros -->
<macro id="nlHeader"> <!-- Regular macros -->
... Header Content ...
</macro>
<macro id="nlFooter">
... Footer Content ...
</macro>
<macro id="nlWatermark">
... Footer Content ...
</macro>
<macro id="nlAltHeader"> <!-- Alternative macros -->
... Header Content ...
</macro>
<macro id="nlAltFooter">
... Footer Content ...
</macro>
<macro id="nlAltWatermark">
... Footer Content ...
</macro>
</macrolist>
...
</head>
<body header="nlHeader" header-height="2.5in" footer="nlFooter" footer-height="0.5in" background-macro="nlWatermark">
... Body Content each page with regular header, footer and watermark ...
<pbr header="nlAltHeader" header-height="2.2in" footer="nlAltFooter" footer-height="0.3in" background-macro="nlAltWatermark" />
... New page with alternative header, footer and watermark ...
... After that each page with regular header, footer and watermark ...
</body>
</pdf>
If you're having issues with your advanced template, don't contact BFO directly. Always contact NetSuite Customer Support.
Bar Codes
When using advanced printing templates, you can add any type of bar code or QR code listed in the Barcodes section of the BFO User Guide. In the template, create a field with a value that can be passed in as the value of that bar code type.
The bar code syntax is shown in the following example.
<barcode codetype="qrcode" showtext="false" height="150" width="150" value="http://www.example.com/" />
For more information, see Generating Custom Bar Codes in Advanced Templates.