question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error when loading PDF that uses system fonts

See original GitHub issue

Test file: https://dl.dropboxusercontent.com/u/16283445/PORTRAIT.pdf

File was produced by Muhimbi PDF converter.

Main text (that uses embedded Tahoma font) renders ok; it is the trial message on top of the file that causes the error. After some debugging, I’ve found that this message references system Helvetica font, and somehow glyphs for it are missing at the time of error.

Error log:

Error: Requesting object that isn't resolved yet Helvetica_path_T pdf.js:205
    at error (http://[skipped]/pdfjs/pdf.js:207:15)
    at Object.PDFObjects_get [as get] (http://[skipped]/pdfjs/pdf.js:4640:9)
    at Object.FontFace.getPathGenerator (http://[skipped]/pdfjs/pdf.js:7675:23)
    at Object.CanvasGraphics.paintChar (http://[skipped]/pdfjs/pdf.js:6105:26)
    at Object.CanvasGraphics_showText [as showText] (http://[skipped]/pdfjs/pdf.js:6291:18)
    at Object.CanvasGraphics_nextLineShowText [as nextLineShowText] (http://[skipped]/pdfjs/pdf.js:6381:12)
    at Object.CanvasGraphics_executeOperatorList [as executeOperatorList] (http://[skipped]/pdfjs/pdf.js:5600:22)
    at Object.InternalRenderTask__next [as _next] (http://[skipped]/pdfjs/pdf.js:4807:39)
    at Object.pdfViewcContinueCallback [as continueCallback] (http://[skipped]/pdfjs/viewer.js:4261:9)

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Reactions:27
  • Comments:35 (2 by maintainers)

github_iconTop GitHub Comments

16reactions
timvandermeijcommented, Feb 25, 2021

This one bug renders the whole library useless.

That’s not really true since the vast majority of PDF files simply embed their fonts (or a subset), in which case there is no problem at all. In fact, that’s highly recommended everywhere, also in the PDF specification, since it ensures that PDF files render consistently across viewers and platforms. By not embedding (a subset of the) fonts you simply cannot assume that the file will look correctly in all viewers, so that’s taking a risk.

the lack of commitment for a fix is frustrating

You have to realize that this is not a trivial issue, and in the meantime work has been done to investigate how we can resolve this. There is a pull request just above (#12726) that aims to provide an implementation for this. While not completely done yet, there is effort being put into this.

If you think this issue deserves more attention, use the thumbs up emoji on the original comment so it shows up higher in the priority list (see https://github.com/mozilla/pdf.js/issues?q=is%3Aissue+sort%3Areactions-%2B1-desc+is%3Aclosed for issues that have been solved that also had a high number of thumbs up), but please keep comments constructive at all times.

11reactions
janumediacommented, Feb 15, 2019

with pdfjs-dist": "^2.2.2 set disableFontFace: false fixed this issue on me.

pdfjs.getDocument( { url: pdfUrl, disableFontFace: false, }

Read more comments on GitHub >

github_iconTop Results From Across the Web

When you create a PostScript file you must rely on system ...
While creating a PDF, you get an error When you create a PostScript file you must rely on system fonts and use document...
Read more >
Change-Pro is showing an Adobe PDF error “Rely on system ...
Right click your Adobe PDF printer and pick Printing Preferences; Uncheck “Rely on system fonts only; do not use document Fonts”; Click on...
Read more >
How to solve common font issues in editable PDFs
STEP 1: CHECK THAT THE FONTS HAVE BEEN EMBEDDED · Open the PDF in Adobe Reader · Right click on the PDF and...
Read more >
How to Fix the "Windows PDF Printer Error: Invalid Font When ...
5. Re-Install or Repair Your PDF Reader in the System Settings ... If you're using alternative PDF readers to Adobe Reader, then you...
Read more >
PDF Font Mapping | 5 Reasons Fonts Don't Display Right
Using the perfect font can make or break the impact a document has. Fonts are also complicated. If you have a PDF file...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found