ANS-1213 · PRINTING, PDF & EMAIL TEMPLATES
How NetSuite Advanced PDF/HTML Templates Process CSS Differently
NetSuite's Advanced PDF/HTML templates utilize the Big Faceless Organization (BFO) Report Generator, which processes CSS and HTML elements with distinct rendering behaviors compared to standard web browsers.
Short answer
NetSuite Advanced PDF/HTML templates process CSS differently because they are XML documents rendered by the BFO Report Generator, not a standard web browser. This results in unique rendering behaviors for elements like tables, where attributes and CSS properties may function distinctly from typical HTML/CSS specifications, requiring specific BFO-compatible approaches for styling.
Scenario
Users developing Advanced PDF/HTML templates in NetSuite may observe that CSS styles and HTML element behaviors do not render as expected, differing from how they would appear in a standard web browser. This discrepancy can lead to unexpected layouts, styling issues, and challenges in achieving desired visual presentations for generated PDF documents.
Solution
NetSuite's Advanced PDF/HTML templates leverage the Big Faceless Organization (BFO) Report Generator, a Java application that converts XML documents into PDFs. This underlying technology means that CSS and HTML elements are processed with subtle distinctions compared to standard HTML and CSS rendering in web browsers. Understanding these differences is crucial for effective template design.Key distinctions in how BFO may handle table models compared to HTML4 and CSS include:
Table cells may occupy the full available space. Unlike standard HTML, where a small cell in a large column might result in a large effective margin, BFO rendering may not exhibit this behavior.
Empty table cells are typically displayed. In standard HTML, it is often necessary to explicitly force the display of empty cells, for example, by using
.Borders and spacing for tables may be handled differently. While the
borderattribute typically sets the border for the entire table, specific BFO attributes for individual cell borders (e.g.,cellborder) or cell spacing (e.g.,cellmargin) may exist or have existed, functioning distinctly from standard HTML attributes likeborderfor cells orcellspacing.Table rows may support padding, margins, and borders, unlike the CSS2 model. However, these properties may be restricted to the vertical axis, meaning horizontal properties like
margin-leftorpadding-rightmay be forced to zero.The collapsing borders algorithm recommended in CSS2 is generally not implemented.
The
CAPTIONtag used in HTML is typically not implemented. As an alternative, a paragraph can be placed immediately before or after the table to serve as a caption.The
colsandrowsattributes commonly available in HTML tables may have no effect on rendering within BFO.For more detailed and current information on BFO's rendering behavior and supported tags, users are encouraged to consult the BFO User Guide or the BFO tags documentation at https://bfo.com/products/report/docs/userguide.pdf and https://bfo.com/products/report/docs/tags/.
Expert NetSuite Support
Need help with this NetSuite issue?
Printing, PDF & Email Templates consulting and configuration support
