I am on Linux, and after processing some PDF files, fonts are changing/transforming to different ones then expected.
The issue is due to the PDF containing non-embedded fonts, which requires any PDF processor to perform font substitution, which can always be error prone.
Ideally, the author of the original PDF re-generates the PDF with all the fonts embedded. If this is not done, then no PDF vendor can guarantee that the PDF will look the same on any device, since there is an external dependency on finding the “correct” font on the system doing the viewing.
If you have contact with the authors of these PDF files, then you would advise them about the above and the need to embed all used fonts.
Otherwise, you can expand the fonts available on your Linux system, to increase your coverage. This would reduce this occurrence, but it is not possible to eliminate this issue on the server side, since you cannot cover the infiniti fonts out there.
Fortunately, we offer a curated collection of freely usable fonts here. Follow these steps to add additional fonts for PDFNet on Linux to use.
- Create the $FONTCONFIG_FILE environment variable, and make it an absolute path to fonts.conf. e.g. “FONTCONFIG_FILE=/home/USERNAME/fonts.conf”
- Download the attached fonts.conf file, and place in the location defined by FONTCONFIG_FILE above.
- Update the three entries to the correct folders. PDFNet should have read access to all 3 folders, and write access to the “” folder.
- Download the fonts available here: https://www.pdftron.com/documentation/web/faq/self-serve-substitute-fonts
- Extract the fonts from the above link and extract to either one of the “” folders specified in your fonts.conf file from step (1) above.
Note, that PDFNet includes FontConfig itself, so there is no need for you to install FontConfig on your instance. Just follow the 4 steps above, and let me know how it works for you.
fonts.conf (170 Bytes)