Access to add and change pages is restricted. See: https://cwiki.apache.org/confluence/display/OFBIZ/Wiki+access

This page is a draft of a best practices document for XSL-FO templates for OFBiz: I'll add here my notes inspired by the manual that I'm reading now, "XSL-FO" by Dave Pawson.

Standard Unit of Measure

The community should select one unit of measure for page dimensions, spaces, indentations, margins: the best options in my opinion are in (inches) or mm (millimeters).
The usage of px (pixels) is discouraged by the XSL-FO specification (Section 5.19) because pixels are device dependent.

 How to insert a line break

The XSL-FO equivalent of the HTML

<br/>


element is:

<fo:block />


We should avoid using formatting based on the block's attribute:

white-space-collapse="false"


Always try to use a common template

In the common component there are a few artifacts that can be used to simplify the creation of new XSL-FO templates in OFBiz.

If possible, do not use fo:table elements for layout

It is often not necessary to use tables for layout as has been done in HTML. fo:block elements should be used instead.

How to escape special characters for xml

The best practice to escape special characters that can cause problems with xml is to wrap the fo.ftl template inside the following tags:

<#escape x as x?xml>... </#escape>


FOP Upgrade  (from 0.20.5 to 0.92)

With revision r481558 the FOP version in OFBiz has been upgraded to 0.92. This might cause problems with some templates as FOP 0.92 is more strict about the interpretation of the XSL-FO 1.0 specification. See the Upgrading-Page on the Apache FOP website for details: http://xmlgraphics.apache.org/fop/0.92/upgrading.html

  • No labels