# How to disable font face via API?

**URL:** <https://pdfjs.community/t/how-to-disable-font-face-via-api/3797>\
**Category:** Technical Support\
**Created:** [September 11, 2025, 12:30am UTC](https://pdfjs.community/t/how-to-disable-font-face-via-api/3797 "2025-09-11T00:30:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dale](https://avatars.discourse-cdn.com/v4/letter/d/ecd19e/32.png) [@dale](https://pdfjs.community/u/dale)\
**Post date:** [September 11, 2025, 12:30am UTC](https://pdfjs.community/t/how-to-disable-font-face-via-api/3797/1 "2025-09-11T00:30:48Z")

</div>

> [@Failed to load font 'g\_d1\_f9': 'SyntaxError: Invalid font data in ArrayBuffer.'](https://pdfjs.community/t/failed-to-load-font-g-d1-f9-syntaxerror-invalid-font-data-in-arraybuffer/3758/10):
>
> Hello dale, Im using a Mac with Chrome, which I think might be the difference. Unfortunately we are no longer updating our version of the PDFJS renderer, therefore we suggest you look at our sister product WebViewer that has our own in-house renderer: [Free Trial: JavaScript PDF Viewer | Apryse documentation](https://docs.apryse.com/web/guides/get-started) Best regards, Tyler

Continuing on from this problem here, we found that disabling the font face in the compiled code actually let us use fallback fonts instead of having an error.

Is there a way to set the disableFontFace boolean programatically without having to edit PDFJS code itself?

**Which product are you using?**

PDJS Web Viewer

**PDF.js Express Version**

8.7.4

**Detailed description of issue**

> [@Failed to load font 'g\_d1\_f9': 'SyntaxError: Invalid font data in ArrayBuffer.'](https://pdfjs.community/t/failed-to-load-font-g-d1-f9-syntaxerror-invalid-font-data-in-arraybuffer/3758/10):
>
> Hello dale, Im using a Mac with Chrome, which I think might be the difference. Unfortunately we are no longer updating our version of the PDFJS renderer, therefore we suggest you look at our sister product WebViewer that has our own in-house renderer: [Free Trial: JavaScript PDF Viewer | Apryse documentation](https://docs.apryse.com/web/guides/get-started) Best regards, Tyler

**Expected behaviour**  
We expect fallback fonts to appear, but this only works when disableFontFace is set to true. We tested this by editing PDFJSDocumentType.js from the package.

**Does your issue happen with every document, or just one?**  
Any document with a particular font.

**Link to document**  
Find this in the provided link.

---

<div class="post-metadata">

**Author:** ![tgordon](https://avatars.discourse-cdn.com/v4/letter/t/aca169/32.png) [@tgordon](https://pdfjs.community/u/tgordon)\
**Post date:** [September 12, 2025, 4:12pm UTC](https://pdfjs.community/t/how-to-disable-font-face-via-api/3797/3 "2025-09-12T16:12:03Z")

</div>

Hello dale,

Thank you for reaching out, it looks like we do not have a publicly available API to disable this at the moment.

In the other thread I suggest looking into our sister product WebViewer, which has in house rendering and much more customization over how fonts behave.

Best regards,  
Tyler

---

<div class="post-metadata">

**Author:** ![dale](https://avatars.discourse-cdn.com/v4/letter/d/ecd19e/32.png) [@dale](https://pdfjs.community/u/dale)\
**Post date:** [September 15, 2025, 5:11am UTC](https://pdfjs.community/t/how-to-disable-font-face-via-api/3797/4 "2025-09-15T05:11:33Z")

</div>

Hi,

Unfortunately the cost to upgrade was astronomically higher and unsustainable for our business. Is there a sales person who may help with upgrading to a similar or more reasonable upgrade pricing path?

---

<div class="post-metadata">

**Author:** ![tgordon](https://avatars.discourse-cdn.com/v4/letter/t/aca169/32.png) [@tgordon](https://pdfjs.community/u/tgordon)\
**Post date:** [September 15, 2025, 3:57pm UTC](https://pdfjs.community/t/how-to-disable-font-face-via-api/3797/5 "2025-09-15T15:57:59Z")

</div>

Hello dale,

Please reach out to our sales team here: [Contact Sales | Apryse](https://apryse.com/form/contact-sales) and explicitly mention you are looking to move from PDFJS Express to WebViewer, we should be able to find a solution that works for you.

Best regards,  
Tyler
