Automatic PDF
Introduction
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. In addition, a header and footer is provided by default.
Header and footer configuration
See Header and footer configuration.
Font configuration and embedding
Overview
These properties allow specifying fonts to embed in PDF files. You do this with 2 properties, which are tied together by a name you choose, and which doesn't have any significance outside the properties-local.xml
. For instance, say you want to use the Roboto font. You first map the family name, which you use in your CSS (here Roboto
, with an uppercase R
) to the name you chose (here roboto
, with a lowercase r
):
Then you indicate where the TTF file for the name you chose is located on disk, using either one of the following two properties. Use the first [SINCE Orbeon Forms 2019.2] if you want to place your font inside the Orbeon Forms WIB-INF/resources
directory, or use the second if you want to place it somewhere else, referring to the file using an absolute path.
Changing the default font
To change the main font, you must map your TTF file to the Helvetica Neue
family. You often need to do this if you are using characters that are not included in the default font used by the PDF engine, for instance to have Chinese characters show in the PDF. To change this, you need to obtain a Unicode font, and configure it as follows, here assuming the file is named arialuni.ttf
:
New default font
[SINCE Orbeon Forms 2022.1]
Orbeon Forms now includes the Inter font by default. This provides more characters out of the box (see Language support).
PDF color mode
By default, the PDF is output with most colors removed and a black-and-white scheme. With the oxf.fr.detail.pdf.color-mode
, you can change that default to allow field colors to be used. This impacts the following form controls:
Explanatory Text
Formatted Text
Calculated Value (if the value is in HTML format)
Accessibility and PDF/A support
[SINCE Orbeon Forms 2022.1.5 and 2023.1]
Experimentally, the following properties allow enabling accessibility and PDF/A support:
oxf.fr.pdf.accessibility
enable or disable accessibility support
values:
true
orfalse
default:
false
oxf.fr.pdf.pdf/a
enable or disable PDF/A support
values:
none
: disabled1a
: PDF/A-1a – Level A (accessible) conformance1b
: PDF/A-1b – Level B (basic) conformance2a
: PDF/A-2a2b
: PDF/A-2b2u
: PDF/A-2b plus Unicode3a
: PDF/A-3a3b
: PDF/A-3b3u
: PDF/A-3b plus Unicode
default:
none
Note that the values above are simply passed to the PDF renderer library used by Orbeon Forms. There is currently no guarantee of compliance with the PDF/A standard.
See also
Blog post: New layout choices for PDF and browser views
Last updated