Orbeon Forms
Search…
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.

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):
1
<property
2
as="xs:string"
3
name="oxf.fr.pdf.font.family.roboto"
4
value="Roboto"/>
Copied!
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.
1
<property
2
as="xs:string"
3
name="oxf.fr.pdf.font.resource.roboto"
4
value="/forms/resources/Roboto-Medium.ttf"/>
5
<property
6
as="xs:string"
7
name="oxf.fr.pdf.font.path.roboto"
8
value="/absolute/path/to/Roboto-Medium.ttf"/>
Copied!

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:
1
<property
2
as="xs:string"
3
name="oxf.fr.pdf.font.resource.arial-unicode"
4
value="/absolute/path/to/arialuni.ttf"/>
5
<property
6
as="xs:string"
7
name="oxf.fr.pdf.font.family.arial-unicode"
8
value="Helvetica Neue"/>
Copied!

See also