Report Manager
ENES

← All articles

Why does the report PDF show a different font on another computer?

· Toni Martir, arquitecto de software

A PDF can either carry the fonts it was written with or just name them. If it only names them and the computer opening it lacks them, that computer uses others, and the invoice statement that looked perfect at the office reaches the customer in a different typeface.

In Report Manager the fix is to produce the report as PDF/A-3: it carries all of its fonts and looks the same on any computer. The classic PDF 1.4 only travels as well if it is written in the PDF standard fonts, which hold Latin characters only; its advantage is size, which can stay under 10 KB.

The same invoice, as PDF 1.4 and as PDF/A-3

PDF 1.4 with standard fonts Helvetica, Times or Courier, not embedded: every PDF reader has them
other computer: same widths characters: Latin only size: 9 KB
PDF 1.4 with a font only named Calibri or the brand font, linked but not embedded
other computer: another, if missing characters: the font's own
PDF/A-3 Every font embedded, with only the letters the report uses
other computer: same lettering characters: the font's own size: 71 KB

Measured with Report Manager's sample invoice, four pages, generated with printreptopdf 4.0.16 on Linux. As PDF/A-3 it carried DejaVu Sans regular and bold, which take up 760 and 709 KB on disk: only the letters of the invoices travelled.

If the font is not inside, it gets replaced

The PDF standard, ISO 32000-1, allows the font to be stored in the file. If it is not, the PDF stores its measurements so that the program opening it can «synthesize a substitute font or select a similar font». According to Adobe, the substitute stretches or condenses so that lines and pages break in the same places, but the letter shapes do not always match, and text in some languages comes out as a row of bullets.

PDF 1.4: tiny, with the standard fonts

The standard defines 14 standard fonts, variants of Helvetica, Times and Courier plus two symbol fonts, which every program that reads PDF must have, or have their measurements and suitable substitutes. They need no embedding, which is why the file is so small: the sample invoice, four pages, comes to 9 KB. It is the choice when size matters.

The catch is the characters. Helvetica, Times and Courier hold Adobe's standard Latin character set, which the standard lists in its Annex D: enough for all of English or Spanish, accents, ñ and euro sign included, but not for Cyrillic, Arabic or Chinese. In PDF 1.4, any other font is either embedded text by text or only linked, and then a computer that lacks it uses another.

PDF/A-3: every font inside

PDF/A-3 is part 3 of the ISO 19005 standard. Its clause 6.2.11.4.1, as quoted by the PDF/A validator veraPDF, requires every font used to draw the text to be embedded. And an embedded font is not replaced: whoever opens the PDF sees the text «in its original font», as Adobe puts it.

Report Manager has produced PDF/A-3 since version 3.7.5, released in December 2024: in the report's page setup, the «PDF A/3» option. The engine then embeds every font, including those the report had as standard, and for an ordinary font only the letters it uses, on Windows and on Linux. The same invoice comes to 71 KB. The option is saved in the report, so the PDF comes out the same from the designer, from printreptopdf or from the web report server.

Windows fonts can be embedded in a document: Microsoft's font FAQ allows it as «a special case», provided the program follows the rules of the font formats. What is forbidden is copying them onto a server, as I explained in the piece on the report that comes out misaligned on a Linux server.

So why does the lettering change?

Because the PDF only names the font and the computer opening it does not have it. With PDF/A-3, Report Manager embeds every font and the report looks the same on any computer; PDF 1.4 with standard fonts is for when size matters more than characters.

Sources

Toni Martir, arquitecto de software · · sources checked on