PDF templates
PDF templates can be used as attachments in e-mails. PDF templates have the advantage that it is possible to control the template design precisely. However, this comes at a price. PDF templates have some limitations:
- Checkboxes are currently not supported
- Only PDFs of type acroform can be used
- No support for rendering images/attachments
- No support for rendering QR codes
- No support for signatures
Creating a PDF template
Please take the following steps to create a PDF template:
- Go to Settings.
- Click on a Templates
- Click on New.
- Enter the label and the name of the status in the Label and Name fields respectively. If you enter a label and press Tab, BizzStream will automatically propose a name. The name has to be unique within the environment.
- Ensure that the Purpose field has the value Document.
- Choose a document definition in the Document Definition field.
- Set the Locale.
- In the field Based On, choose for HTML.
- Click Ok for saving the new template.
Preparing a PDF file
To prepare a PDF for serving as a template please take the following steps: 1. Create a PDF of the type acroform (xfa is currently not supported). 2. Use BizzStream Expressions to create the correct reference to fields and lines. 3. Upload the PDF file to BizzStream.
Add fields
Fields in the PDF files have names that act as placeholders. When you want to fill a form element with a value from the document element, use a placeholder. This placeholder may contain formatting expressions. For instance:
{!orderDate{"format":"MMM Do YY"}!}
is filled with a value "Apr 6th 16" if the orderDate field has value 2016-04-06.
Add lines
For adding lines please use the following syntax:
{!<lineName>.<fieldName>{"index": <lineNumber(0 based)>}!}
So if you have a line named 'orderLines', and a field named 'quantity', you can render the quantity of the first 3 lines as follows:
{!orderLines.quantity{"index": 0}!}
{!orderLines.quantity{"index": 1}!}
{!orderLines.quantity{"index": 2}!}
Note that for each repeat of a line you need to add an index, this is not the case for HTML templates.