X
Tap here to go to the mobile version of the site.
Your Firefox is out of date and may contain a security risk! Upgrade Firefox

Support Forum

PDF.js viewer mangles embedded font

Posted

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.

Chosen solution

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:

Read this answer in context 5

Additional System Details

Installed Plug-ins

  • Shockwave Flash 11.6 r602
  • Next Generation Java Plug-in 10.17.2 for Mozilla browsers
  • NPRuntime Script Plug-in Library for Java(TM) Deploy
  • Google Update
  • Adobe PDF Plug-In For Firefox and Netscape 11.0.02
  • Adobe Shockwave for Director Netscape plug-in, version 11.6.6.636
  • BlackBerry WebSL Browser Plug-In
  • Version 0.9.9, copyright 1996-2009 The VideoLAN Teamhttp://www.videolan.org/
  • RealPlayer(tm) LiveConnect-Enabled Plug-In
  • 6.0.12.69
  • Windows Presentation Foundation (WPF) plug-in for Mozilla browsers
  • DRM Netscape Network Object
  • Npdsplay dll
  • DRM Store Netscape Plugin

Application

  • User Agent: Mozilla/5.0 (Windows NT 5.1; rv:19.0) Gecko/20100101 Firefox/19.0

More Information

the-edmeister
  • Top 10 Contributor
  • Moderator
3197 solutions 24404 answers

My advice is to change the font you are using.

Question owner

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.

cor-el
  • Top 10 Contributor
  • Moderator
10758 solutions 96832 answers

Chosen Solution

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:

Question owner

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

cor-el
  • Top 10 Contributor
  • Moderator
10758 solutions 96832 answers

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
JohnJamesWilliamns 0 solutions 5 answers

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)

the-edmeister
  • Top 10 Contributor
  • Moderator
3197 solutions 24404 answers

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.

cor-el
  • Top 10 Contributor
  • Moderator
10758 solutions 96832 answers

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

JohnJamesWilliamns 0 solutions 5 answers

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

cor-el
  • Top 10 Contributor
  • Moderator
10758 solutions 96832 answers

Did you try the PDF Viewer version from the Mozilla Add-ons website?

JohnJamesWilliamns 0 solutions 5 answers

Yes I did aswell. "PDF Viewer 0.8.1" does not have any efect. Fonts (embeeed Arial-BoldMT/Type1/Encoding custom) are still messd up.

JohnJamesWilliamns 0 solutions 5 answers

The Type1 Embedded font problem remains even with Firefox v21.x on Windows platform. With given PDF link below, the browser refuses to render the document properly by giving the user “This PDF document might not be displayed correctly”.

http://w1.if.fi/web/fi/corporate.nsf/0/628CF21A2A4509C4C1257B720028100B/$file/vaha9643998344652.pdf

niziolekc 0 solutions 2 answers

Our issue is similar. We have spacing issues in the new Firefox v21 PDF.JS which causes our columns with numerical data in them to be misaligned. Switching back to the adobe acrobat plugin fixes the issue, but this is an unacceptable method to make customers do on their own computers..

cor-el
  • Top 10 Contributor
  • Moderator
10758 solutions 96832 answers

Helpful Reply

You can try to test if this already has been fixed.

Latest development version of the PDF Viewer (pdfjs) as a Firefox extension:

niziolekc 0 solutions 2 answers

Yes, I tried v22 beta and it is fixed. Any word if this version of PDF.js can be released as a v21 patch?

cor-el
  • Top 10 Contributor
  • Moderator
10758 solutions 96832 answers

No. You can only get a newer version of the PDF Viewer by either installing the one from the Add-ons website or the latest development version via the link I posted above.

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

Latest development version of the PDF Viewer (pdfjs) as a Firefox extension:

JohnJamesWilliamns 0 solutions 5 answers

Nope, PDFViewe 0.8.213 did not resolve my PDF issue that is linked here.

yusufsp 0 solutions 1 answers

I'm still having a problem with PDF files we generate on our website. We use special custom fonts that are embedded in the document. The generated PDF displays fine in all other viewers except for the Firefox internal PDF.js. In Firefox, the two characters 'g' and 'q' are displayed as spaces and the 'j' appears truncated. All other characters seem to work fine.

Here's a link to the PDF file: https://docs.google.com/file/d/0B83VcttTq86XRmFRQmNrb3JjN00/edit?usp=sharing (download the file and drag-drop into Firefox to see the problem)