I am creating one app in which I need to view pdf, word, and excel files. Can I view these files without using web view? Can anyone provide me with sample code for doing the same.
Or use a web based viewer like FlexPaper
http://flexpaper.devaldi.com
You'll need to use Quartz directly. Documented here:
http://developer.apple.com/library/ios/#documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_pdf/dq_pdf.html#//apple_ref/doc/uid/TP30001066-CH214-TPXREF101
You need to use CGPDFDocument (Apple doc here).
This blog also has very detailed explanation on how to implement it.
Related
I need to create one sample application for NITF-News Industry Text Format in iphone. I don't know how to begin. What Language(Css,Javascript like that..) should i use to read the content from .xml(NITF) files and design the article pages in iphone.I red from this Link. NITF uses the eXtensible Markup Language(xml) to define the content and structure of news articles.
Please anyone give me some guidance to start.
Thanks in Advance
Use NSXmlParser to parse the data.. Then display the content accordingly..
I have been looking for a way to present an interactive pdf file (created by in-design) on
the iPhone. I read a bunch of questions here but none says how to do it. The pdf file contain the text and in the middle it contains a 3d module, but when I present it on the iPhone it shows only the text and an empty white box where the module should appear.
Is it even possible to do it?
I'll be glad for any assistant on this subject or even where to look.
Thanks in advance,
Shahar.
Apple's PDF parser does not support 3D stuff. You're better of implementing the 3D part yourself and just adding that as a UIView on top of the PDF. There are several PDF frameworks that help with that (see https://stackoverflow.com/questions/3801358/pdf-parsing-library-for-ios)
Another alternative might be licensing Adobe's iOS rendering engine. But I doubt that they already added 3D support (or that they will be). Also, from what my sources tell me, pricing is rather high and apparently the framework not very developer friendly. (But I haven't used it myself)
Let us say I have an application that has a bunch of text and image data. It there a way to then convert the strings and images within my application into PDF format which I could then email?
What would be the best approach to this?
With such a general question, it's hard to answer with anything that isn't more or less a repetition of what Apple's docs say: Generating PDF Content
Apple's support docs are pretty good on this. The gist of it is you want to create a pdf graphics context CGPDFContext and then draw to it. The wierdest thing is that you have to flip the y axis on your drawings to PDF because iOS and Core Graphics use different origins for the axis. All this is explained in the apple docs though. If you have any specific questions, I'm new to developing and stack overflow, but I'd be happy to help you out.
If you want to see how my app writes PDF, check out Photo Logger in the app store.
Is it possible for it to retain its display formatting, and links to Internet sites?
UIWebView can display Excell documents. Just open them like you would any other HTML file. Not sure about the display formatting or links though.
http://developer.apple.com/library/ios/#qa/qa1630/_index.html
My approach would be a little bit different. If you have a way to get to the displayed data (e.g. parse the excel file, or if possible use a csv or plist). Then you could use CorePlot to display the data. I really like this SDK, because you can nearly customize everything. ;-)
Sandro
How can I scan links in a PDF Document? Do I have to use Quartz? Which methods/functions?
Yes, you need to use Quartz. You have to parse it out from the PDF. This guide can help you.
http://developer.apple.com/library/ios/#documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_pdf_scan/dq_pdf_scan.html#//apple_ref/doc/uid/TP30001066-CH220-TPXREF101
I recommend reading the PDF specification so you will know what to look for.
The links are stored in the Annotations object so you will need some software to parse those.