-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Black text not visible on page in PDF #5291
Comments
Looking at the page content font size is set to 56234:
We probably shall specify the max limit to the font size we use for canvas painting, similar with what we do for min font size. |
https://github.com/mozilla/pdf.js/blob/master/src/display/canvas.js#L28 Setting as a starter bug, just to verify if capping the font size to some reasonable number e.g. 64 will fix the issue. |
You should look at bit more on the pdf. We do not use 1/72 inches as our units. We use 1/10000 mm because we need that preciseness. Hence at the start of the pdf we translate all units to this: 0.000283465 0 0 0.000283465 0 0 cm That 56234 is translated to a normal font size of 16. |
Right, during painting to canvas we are trying to use the original font size e.g. ctx.fontStyle = "56234px f1"; in your case. We adjust the font size for really small fonts atm, but we should do that for really big fonts as well. |
Arh okay. Will see if you are able to fix the bug. |
@ccisoc are you author of this PDF? can we use it in our reference tests? |
Issue mozilla#5291 black text not visible Optimized code
Issue mozilla#5291 black text not visible Optimized code Lint error fix
@yurydelendik Yes you can say i am the author of the PDF. Unfortunately we embed a font from Ghostscript in the PDF which i do not know if we are allowed to distribute to other people than our customers and their customers. So on the grounds that i do not want to go through legal i'dd rather say no. But i'll try to see if I can produce a similar PDF without an embedded font for you to use in reference tests. |
Issue mozilla#5291 black text not visible Optimized code Lint error fix Fixed fontSizeScale issue
Issue mozilla#5291 black text not visible Optimized code Lint error fix Removed trailing spaces
Black text not visible mozilla#5291 Issue mozilla#5291 black text not visible Optimized code Lint error fix Removed trailing spaces
We have a PDF produced by our own application through our own pdf implementation. If we open a PDF with text using PDF.js the text is not visible. When I inspect the page I can see the text is present in the page source, but not present in the page view.
The same PDF does not have any issues in Adobe Acrobat, Apple Preview, Artifex Ghostscript, printers and RIPs. I tested it with newest version of of Firefox 32.0. It was also present in firefox 25.
Pdf is available here:
http://docdroid.net/hhoq
Screenshot of PDF open in Adobe Reader:

The text was updated successfully, but these errors were encountered: