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

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?

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

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

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

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.

Related

iOS - How to install a custom font into the iPhone OS (Not just my APP) just like the AnyFont App?

My App uses a custom ancient font for a language that is about to be extinct, interesting right.
Now I am using the custom font thru out my app but I need to install the font into the iOS operating system I hope this is possible so that I can copy and paste text from my app into other apps like email, SMS and especially Facebook otherwise the chars come up as squares because Apple don't even support their unicode.
I think its possible because AnyFont is an app that does that without jailbreaking.
This feature is a crucial feature for users using the app to be able to communicate with the language.
So this would be much appreciated if someone could help me with some hints please.
I am not sure if I need to post code here !.
Thank you,
Kind Regards,
Will
You have to create a configuration profile for each font. With the manual installation by the user of that profile the font will be available for Numbers, Keynote and some others. It's available since iOS 7.
See Apple's reference page for that. Basically, you have to use the Font Payload:
A Font payload lets you add an additional font to an iOS device. Font
payloads are designated by specifying com.apple.font as the
PayloadType value. You can include multiple Font payloads, as needed.
...
Each payload must contain exactly one font file in TrueType (.ttf)
or OpenType (.otf) format. Collection formats (.ttc or .otc) are not
supported.
You can also take a look at here:
http://www.saturngod.net/create-custom-font-for-ios-7
If you're using a Mac, you can also checkout Apple's Apple Configurator which allows you to create those MDM profiles too.

Quick Look and UIWebView supported file types

Is there an updated list of file types that can be displayed using UIWebView that ships with iOS 6.0? I am aware of the Apple doc and an earlier question on here about this topic. However, both are outdated and don't list all supported types. For example, .mov and .m4a types can be displayed using the UIWebView but aren't listed in the doc. The same question goes for Quick Look types. Its doc also hasn't been updated since 2010.
The back-end of UIWebView is WebKit (same thing used by Safari and other major browsers.) Whatever WebKit supports, UIWebView supports that, too.
This is also true in terms of how it displays/renders pages, HTML-5, etc.
NOTE: keep in mind which version of WebKit is in which version of iOS. I don't think it changes that often, but it's something to keep in mind when major feature updates come along.

Opening link on an HTML page to a specific page of a PDF on an iPad

I've been searching for the answer to this for the past two days but can't get it to work.
I'm working on a web app built in HTML that is optimized for the iPad. One of the pages has different links to different pages of a 50 page pdf. I used the link on Adobe's site http://helpx.adobe.com/acrobat/kb/link-html-pdf-page-acrobat.html using sample.html#page=2 and that worked in desktop browsers on Windows, but not on the iPad. I've also tried creating destinations in the PDF and linking to them, but that didn't work either.
Any help would be greatly appreciated. The only real requirement is that no additional software can be downloaded for viewing. Thanks again.
Just remove the "=" sign.
So: sample.html#page2
That should work for iPad.
Those links work only with desktop versions of Adobe products. It might be possible for Adobe to add support for them in Adobe Reader for iPad in the future.
Just
filename.pdf#pagenumber
ex
wwww.domain/pdffile

How can use a new font in iphone application

I want to used the particular fonts for my application. But I don't how can use that font that are in the iPhone SDK library.
Any idea how can I do this ?
By the way I want to use hindi and punjabi fonts in it.
The FontLabel open source project provides a means of drawing your own .ttf fonts on the iPhone.
There is currently no official way to do this; but given the presentations of iWork on the iPad, it's possible that the 3.2 SDK adds this.
Edit: Assuming Jasarien is right about this; you'd probably be better off developing for iPhone OS 3.2; as you'll need an iPhone Dev Central membership to publish your applications at any rate; you might as well get started right away.

PDFKit framework available on the iPhone OS?

I'm curious to know whether the PDFKit framework is available for use within the iPhone OS, in order to build a PDF reader a bit more sophisticated than the one available by simply opening PDF documents with UIWebView.
Just wondering if this is an option or not.
Grab the official sample code called QuartzDemo which has an example on how to manipulate a PDF file using Quartz graphics. The output seems faster than the UIWebView.
The PDFKit is not available on iPhone at this time. Certainly the functionality is there, but Apple has not opened it up in an available framework. You should file a bug on this if you'd like to see it in the future.
If you want more control over PDF, there are many ways to manipulate PDF content using Quartz graphics.