interesting question. I am about to build an iPad application that shows the user pages of text. This text is created as follows: original XML (from a MarkLogic server no-less…) and assets (mainly images) converted to XHTML and rendered in the objective-c native app for the user to view.
The user then annotates the content in two ways: highlights and makes notes. Both of these can be enabled via inserting some appropriate tags in the XHTML and rendering it correctly in the app. Not a problem so far.
However – now the user wants to export the annotated document as a file and send via email (not in XHTML format) as an attachment.
I want to enable the user to export to a common filetype (e.g. Odf, PDF, docx) that supports comments and highlights. This conversion of XHTML->??? must be done in the app.
Any ideas on the best format and how easily to achieve the transformation in the native app using objective-c code/libraries?
Thanks in advance for any help.
This won’t be an entirely satisfying answer, but hopefully it will get you started.
It seems like the handiest way to do this is to send the html document to a server, do the conversion on the server, and send resulting rendered pdf (or whatever document format you choose) back to the iphone. If you take this route, the wkhtmltopdf library looks like a decent candidate, although I’ve never used it myself.
About five minutes of googling turned up some conversations about folks who were trying to the html -> pdf conversion on the device itself, but in my very brief reading, I didn’t find anything promising. Here are some starting points: