cancel
Showing results for 
Search instead for 
Did you mean: 

PDF.js viewer mangles embedded font

SOLVED
Highlighted
New User

PDF.js viewer mangles embedded font

I have a number of documents I want to embed in webpages for easy access. These are PDFs generated with pdftex locally under MikTeX. They use Adobe Minion Pro font. They render flawlessly in Adobe Reader, Sumatra, PDFXchange, and in Chrome (with its built-in viewer). They are also fine in APV PDF Viewer (MuPDF library) and PDF to GO (Documents to Go) on Android . . . you get the idea. But in Firefox they render interspersed with random characters. Example pdf and screen captures available (I don't see a way to post them).

In the meantime I've replaced the PDF.js with the Adobe Plug-in which fixes the issue for me. I'm concerned about others who may visit the site with Firefox as the default setting leaves these documents all but unreadable. Must I alter them to use a different font in order to preserve compatibility with pdf.js? Minion is widely distributed and well regarded (and not cheap) it would require significant adjustment to the formatting as well . . . Please advise.

1 ACCEPTED SOLUTION

Accepted Solutions
Site Moderator

Re: PDF.js viewer mangles embedded font

The latest version of the PDF viewer is available as an extension and does a better job than the 0.6.143 version shipped with Firefox 19 in a lot of cases.

You can find the latest version of the PDF Viewer (pdfjs) extension here:

18 REPLIES
Support Forum Moderator

Re: PDF.js viewer mangles embedded font

My advice is to change the font you are using.

New User

Re: PDF.js viewer mangles embedded font

In addition to being a non-trivial amount of work to do that, this isn't some random font I dug up off the internet. Adobe Minion Pro is distributed with Adobe's own PDF authoring tools for goodness sake and LaTeX output is about as standardized as pdf tools get. Since pdf.js is the only viewer I've found, out of the half-dozen I regularly work with, that has any issues with my documents; I'm fairly confident the problem is pdf.js

Obviously replacing the font may be a possible solution, but it's the one I was trying to avoid by opening this ticket.

2013-03-25-18-26-26-763f7f.png 2013-03-25-18-26-37-986c37.png
Site Moderator

Re: PDF.js viewer mangles embedded font

The latest version of the PDF viewer is available as an extension and does a better job than the 0.6.143 version shipped with Firefox 19 in a lot of cases.

You can find the latest version of the PDF Viewer (pdfjs) extension here:

New User

Re: PDF.js viewer mangles embedded font

That worked brilliantly . . . thanks for the excellent suggestion. Will this version be pushed out with the next release of Firefox? If so, time should remedy this issue for me as my users update their browsers.

Thanks again cor-el

2013-03-25-19-36-24-4457d4.png
Site Moderator

Re: PDF.js viewer mangles embedded font

The current 20.0 beta has an older 0.7.28 version of the PDF Viewer.
The current 21.0a2 Aurora build has the 0.7.236 version and the 22.0a1 Nightly build has a newer 0.7.337 version, so development is still ongoing.

You can see the version number of the built-in PDF Viewer via this URL:

  • resource:///chrome/pdfjs/README.mozilla

Re: PDF.js viewer mangles embedded font

I’m also experiencing this font rendering problem. My PDF documents are automatically generated with embedded Arial-Bold family type1 fonts inside. PDF document version is v1.4. Firefox v18.x & v19.x & v20.x can’t render the document properly on to the screen and fonts are enlarged to mess. I discovered that if I tweak the html5 that PDF viewer creates by removing <style id="PDFJS_FONT_STYLE_TAG"> tag from the <head> (using e.g. Firebug), the PDF renders perfect. User just needs to Zoom Out/in once to the redraw the kick in. So, Firefox fix is needed here concerning the embedded fonts. The Fix needs to be inside the normal Firefox maintenance service cycle (automatic update)

Support Forum Moderator

Re: PDF.js viewer mangles embedded font

Firefox 21 is due to be released later this morning (Tues, May 14). The latest version of PDF.JS should be in Firefox 21, from what I have read.

Site Moderator

Re: PDF.js viewer mangles embedded font

The current version on AMO is 0.8.1 and Firefox 21 comes with 0.7.236 (Nightly has 0.8.47)

Re: PDF.js viewer mangles embedded font

FireFox v21. beta did not resolve the Font problem I'm having here...