In my iPhone application I'm generating an HTML file. I would like to convert that HTML file to a PDF file programatically. The PDF will then be attached to an email.
Does anyone know (have an example) how to convert the HTML file to a PDF?
In my iPhone application I'm generating an HTML file. I would like to convert that HTML file to a PDF file programatically. The PDF will then be attached to an email.
Does anyone know (have an example) how to convert the HTML file to a PDF?
maybe you should start from here: http://developer.apple.com/iphone/library/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq%5Fpdf/dq%5Fpdf.html
I was looking into this as well, and could not find a way. I was hoping to find an existing C or C++ library that could do the conversion that would run on the iPhone, but I could not find one. Please let me know if you do.
You can actually take the screen image out of a UIWebView and write that to a pdf, but it ends up as a small low-res bitmap, so not very useful.
Also note that there is a huge bug with the iPhone sdk's handling of text in a pdf. Basically the pdf's it produces work great on a mac and the iPhone, but are not technically valid, and will not necessarily render properly everywhere. See this post for a summary: http://www.iphonedevsdk.com/forum/iphone-sdk-development/15505-pdf-font-problem-cant-get-cids-glyphs.html#post97854