Quote:
Originally Posted by aderrington
Hi pmattf,
Did you ever manage to get this to work and save correctly instead of a bitmap in the pdf??
Trying to figure this out aswell.
Cheers!!
|
No, there is no way to get anything out of the UIWebView other than a bitmap. And I could not figure out a way to get one out that is big enough to be useful (though I would not rule out the possibility that you could get a larger one than I did).
In MacOS it is trivial, because there is pdf rendering built into the print system (i.e. the Save as PDF in the print dialog). So you can easily take most anything, and render it out as a pdf.
But as far as I could determine, there is no existing code that runs on the iPhone that takes html and converts it to pdf. You would either need to find some C code that does this, and get it running on iPhone, or do it via a web service (there are plenty of options for libraries that would run on a web server to do it).
What I ended up doing is vastly simplifying the formatting I was doing, so that I could just render it out as strings and images with the pdf functions that the iPhone does have. But per my post a couple up, the resulting pdf's are not actually valid, and will not work everywhere.