Changing the font on PDF templates
If you’re customizing PDFs by editing the XSLT template, you can also change the font used in the generated document.
Available Fonts
Helvetica (default)
Helvetica is a sans serif font, which means the letters have clean, simple lines without decorative strokes. It has a modern, easy-to-read appearance and is commonly used for business documents.
Times New Roman
Times New Roman is a serif font. Serif fonts include small decorative strokes at the ends of letters, giving text a more traditional and formal look.
Note
Helvetica and Times New Roman use proportional spacing, which means each character can have a different width. For example, the letter "W" takes up more space than the letter "I".
Courier
Courier is a monospace font, meaning every character uses the same width. This makes it particularly useful for displaying code, technical documentation, or any content where text alignment is important.
How to change the font
To specify a font, update the ‘font-family’ attribute in your XSLT. For example;
<fo:flow flow-name=”xsl-region-body” font-family=”Times New Roman” color=”rgb(0,0,0)”>
Note
Only supported fonts will be displayed correctly in the generated PDF. If an unsupported font is specified, the PDF will fall back to a different font.