PDF files created on iPad don't display correctly on Windows

5.2k views Asked by At

My iPhone app creates PDF files (in Arial font). The plain iPhone 3.1.x version works great (other than the known issue that PDF files created on the iPhone can't be viewed correctly in Google Docs or on the BlackBerry).

As I am updating my project for OS 3.2 and the iPad, it works just the same, and the PDF files still look great on the iPhone, iPad and Mac OS X (Preview app). But now on Windows (Vista), Acrobat 9.3.1 says "Cannot extract the embedded font 'XYZABC+ArialMT'. Some characters may not display or print correctly".

And in fact Acrobat then uses some generic font instead of Arial (or whatever other font I try).

Quartz 3.2 seems to generate these "random" embedded font names each time it creates a PDF file (the XYZABC changes around each time). I can't tell whether the problem is just the somewhat strange "temporary" embedded font name with the plus sign, or the way Quartz 3.2 is embedding fonts.

I have tried my existing code (using CGPDFContext* functions), and also the newly supported UIGraphics* functions, with the same results.

How can PDF files be created on the iPad to display correctly on Windows?

4

There are 4 answers

4
Phil Willoughby On BEST ANSWER

Important update: as of iOS 4.2, Apple have fixed the bug I reported; PDFs generated from Quartz on iOS now contain correctly embedded fonts. I am leaving the remainder of this answer as-is, but do not use this mechanism on iOS 4.2 or later.

Adobe Reader is correctly, if unhelpfully, following the PDF spec. I have investigated this because it was affecting one of my apps and documented my findings here: http://web.archive.org/web/20180909095127/http://blog.nomzit.com/2010/08/18/annoying-bug-in-quartz-pdfcontext-font-handling/

There is a simple workaround documented there which causes Adobe Reader to behave the same as the more helpful alternatives.

I have also reported the bug to Apple

0
krummnagel On

Try to use Foxit Reader for opening your PDF files on Windows instead of Adobe Reader. It worked for me.

0
Brad Larson On

In addition to Phil's analysis, I've found that several Windows users did not have one or more of the standard fonts (like Helvetica) installed. The PDFs generated via Quartz would reference one of these standard fonts, which Adobe Reader would render using the next closest font in its lookup table, leading to odd-looking PDFs. The iPhone / iPad standard system fonts were not being embedded properly, possibly due to what Phil has found in the Quartz-generated PDFs.

In all the cases I ran across, this was solved by having the user install Helvetica (or any other missing font) on their Windows machine, at which point the PDFs would render properly.

1
eli On

Using Pages on an iPad, the same issue occurs. I'd be interested to find an answer:

http://discussions.apple.com/thread.jspa?threadID=2389034&tstart=0