views:

1819

answers:

5

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* funtions), 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?

A: 

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

eli
Thanks eli for this link. It is helpful to confirm it is not just us.
Morgan
A: 

I have just made a sales document for one of my (windows based) customers..but I had to mail it to myself first, open it in preview, print it to a PDF document before I could mail it :( This is totally unacceptable in my opinion...I've payed a lot of money for an iPad & Pages and it is not compatible with the greater part of the market! Windows is having problems "unpacking" the enclosed fonts (which have some weird characters before them..).. So far the workaround with opening it in Preview and printing it to a new PDF document is the only fix...

Pascal Dorland
+1  A: 

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

krummnagel
+2  A: 

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://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

Phil Willoughby
Thanks for this post. I would vote up your answer but can't yet.
Morgan
@Phil Willoughby: do you mean "... reported the bug to Adobe"?
Peter Mortensen
No, Adobe Reader is behaving correctly in this case, it is the Quartz-produced PDF which is wrong
Phil Willoughby
A: 

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.

Brad Larson