-
Notifications
You must be signed in to change notification settings - Fork 10.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when loading PDF that uses system fonts #4244
Comments
This fails because the font isn't loaded when we attempt to fetch it in font_loader.js#L313. I unfortunately don't know how we could address this issue, since building P.S. I also noticed that fixing this issue would address one (or two) of the files listed in http://bthorben.github.io/pdfRepo/#crashed. |
Can there be a solution like one of these: 1 - option to allow use some default font or some font what already been used for exact file What do you think? |
We prefer the first option, however we don't embed any fonts yet and rely on system to contain those for some functions. We can certainly ignore, once we find how to properly stub it (For these font, we can generate empty letters outlines when requested) |
At least open the possibility to .catch(...) this error instead of just stopping everything until you can find a better solution. Unfortunately this problem breaks functionality in our live environment which is... bad. |
Is there any workaround available? Or some sort of error catching mechanism suggested by @xwcg ? |
A dupe was filed here: https://bugzilla.mozilla.org/show_bug.cgi?id=1463728 |
Hello everyone, |
Any update on this?, Its from 2014 and still not solved |
@diego-lipinski-de-castro FYI, that #9809 merge fixed this if you pass in ignoreErrors: true into the getDocument function. If you use the npm pdfjs-dist it's not updated yet. I just built from source and PDFs that used to complain about fonts now process correctly with canvas output. Everything seems fine. |
@sirisian thanks for your update. Looking forward to the release |
@sirisian do you know when will be the update for npm pdfjs-dist? and if there is a workaround for npm? |
Any updates on this fix release for npm pdfjs-dist ? |
Hi, I also encounter this error. Is there a way to substitute font that aren't present on the system with a default one? |
Hi @timvandermeij when are we likely to see this fix in pdfjs-dist ? |
@Snipeye Did you find a fix for this #4244 (comment) ? A lot of people are running into this bug and a lot of issues are being closed stating that they are a duplicate of this issue . If someone has a fix please do post it here. |
There is some code in #12711 that falls back to |
This comment has been minimized.
This comment has been minimized.
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.
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. |
I see this is closed, but what's the solution? I recently updated my
|
For anyone else getting an error during
pdfjs-dist has a folder You have to set the
You can use a relative path, too, but note that it must be relative to the script entry directory. I wrap getDocument for use in node, so I don't have to set standardFontDataUrl all the time. |
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as off-topic.
This comment was marked as off-topic.
I was able to disable the warning with: getDocument({ url: pdfPath, useSystemFonts: true }); But now I'm thinking maybe I should embed the font directly so that it will be consistent on all machines. |
Coming back to this: |
Can we at least specify what the fallback font should be in case system font is used? |
THIS IS what iam looking for in past week |
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:
The text was updated successfully, but these errors were encountered: