Introduction
Form Builder and Form Runner can produce PDF output in two ways:
- Automatic
- The PDF is produced based on the appearance of the form in your web browser. This is similar to printing a read-only version of your form.
- As a form author, you do not need to take any action to enable this mode.
- Template-based
- You upload a PDF file using the Upload PDF dialog in the toolbox. At runtime, Form Runner fills-out Acrobat fields in the template.
- This mode is automatically enabled for a form if a PDF template is attached.
Availability
- Automatic PDF generation is available in Orbeon Forms CE and PE
- Templates are an Orbeon Forms PE feature.
How PDF templates work
The purpose of the PDF template is to allow using existing PDF forms and using Form Runner to fill them out. This has benefits:
- Your organization might already have PDF forms.
- Those forms might have been designed carefully for printing or archival purposes.
A PDF template must include Acrobat form fields. You can create these with Acrobat Professional. At runtime, when producing a filled-out PDF, Form Runner performs the following operations:
- Reads the PDF template
- Reads the filled-out form data as XML
- Fill out the fields in the PDF template based on the data.
Creating a PDF template for use with Form BuilderSteps
In order to create a template, you need Acrobat Professional or a similar tool to edit PDF fields. Here we assume Acrobat Professional. - Open an existing PDF document
- Perform automatic field detection
- Remove incorrectly detected areas
- Set all field names, as per the
section-name$field-name explained below - For languages like French, make sure that fields in the form have an Arial font, not Helvetica. Not using Arial can cause issue with accents.
Example of form fields in Acrobat Professional
Naming fieldsForm Runner identifies the PDF fields to fill-out based on their name. Those names must follow the following convention: - Let's assume you the name of a field to
my-field and the name of the section in which that field is to my-section. - For all control other than checkboxes (see below), the name of the PDF field must be:
my-section$my-field. [LIMITATION] It has been reported that Adobe Livecycle Designer does not support the $ character in field names.ControlsMulti-line text- Enable multi-line in Acrobat form field
- Set a white background if necessary to hide dotted lines from the original form
Exclusive checkboxesCreate multiple fields in the PDF (radio buttons), all with the same name: my-section$my-field, but each with an Export value matching the corresponding value in your form: - Use PDF radio buttons with Cross or Check appearance
- Use the same name for all buttons
- Use different export values for each button
- The checkbox value (and NOT the label) is used by Form Runner to match on the export value
Non-exclusive checkboxes[SINCE 2011-05-12]
Create multiple fields in the PDF (checkboxes), each with a different name of the form my-section$my-field$value, where value corresponds to the value in your form. The Export value for all the checkboxes must be true. Image attachments[SINCE: 2011-05-13]
To place an image attachment on your PDF, simply add a placeholder Acrobat form field. - This field will be used by the PDF engine to determine the image location and dimensions.
- Name the field using the
section-name$field-name format, where field-name is the name of the image attachment field in Form Builder.
When the resulting PDF is generated by Form Runner, the field will not contain text, but the image attachment will be placed within the space defined by the field.
Repeats[SINCE: 2011-09-21]
When a control is within a repeat: - the identifier of the repeat must be included in the acrobat field name
- the repeat iteration must be appended to the acrobat field name
So for example, if you have the hierarchy: - my-section
- my-repeat
- my-input
The field names must look like: my-section$my-repeat$my-input$1 for the first iterationmy-section$my-repeat$my-input$2 for the second iteration- etc
|