PDF files are supposed to be rendered exactly the same, no matter which PDF viewer you’re using. One reason why this is the case is because a PDF file can embed the fonts required to render it.
However, sometimes — due to size reasons or other considerations — fonts are not embedded, which makes the PDF viewer look for fonts on the current system. Depending on the fonts that are available, this can cause rendering problems.
While the best option is to always embed the fonts in the PDF, this isn’t always possible, especially if you’re working with third-party PDF files. Plus, a font that includes all characters is usually more than 200 MB in size. That’s tough for a web browser. To do this effectively (and to make it work at all in older browsers) this needs a server. That’s why we built custom font path support into PSPDFKit Server.
This can be done by adding the following to your
docker-compose.yml file, like so:
1 2 3
pspdfkit: volumes: - /font-directory-path-on-the-host:/custom-fonts
At this time, it is not possible to add custom fonts in standalone. However, this is something we are looking into.