Using WebFontDownloader

Product: iOS & Android Mobile Viewer

Product Version: 12.0

Please give a brief summary of your issue:
Certain fonts aren’t rendering/loading when viewing a PDF

1 Like

Hello, I’m Ari, Apryse’s AI support bot.
While you wait for one of our customer support representatives, I can help you with your question.

To address issues with certain fonts not rendering or loading in PDFs on iOS and Android using the Mobile Viewer, you can provide additional font resources using the WebFontDownloader API. This helps ensure that missing or custom fonts are available during PDF rendering or conversion.

Here’s how you can configure custom web fonts and enable font downloads:

iOS Example

[PTPDFNet Initialize];
// if fonts.json is at /home/user/webfonts/fonts.json
// this can also be an https URL
[PTWebFontDownloader SetCustomWebFontURL:@"file:///home/user/webfonts/"];
// allow PDFNet to access the network to download missing fonts when possible.
[PTWebFontDownloader EnableDownloads];

Android Example

PDFNet.initialize()
// if fonts.json is at /home/user/webfonts/fonts.json
// this can also be an https URL
WebFontDownloader.setCustomWebFontURL("file:///home/user/webfonts/")
// allow PDFNet to access the network to download missing fonts when possible.
WebFontDownloader.enableDownloads()

Steps:

  1. Download or create a curated font package (e.g., Self serve font package).
  2. Extract the fonts and ensure the fonts.json is present in your directory.
  3. Set the custom font URL using WebFontDownloader.setCustomWebFontURL(...).
  4. Enable downloads with WebFontDownloader.enableDownloads().

For more details on creating and using substitute web fonts, see the self-serve substitute fonts FAQ.

If you continue to experience issues with specific fonts not rendering, let us know and a human will follow up with you shortly.

Used 5 sources

Hopefully, this helps you solve your problem while you wait for a human to get back to you.
Please note: I’m an AI bot, and my answers may not always be perfect. Double-check any critical details.

1 Like