How to display a PDF from NSMutableData? - iphone

I need to display a PDF I have stored into an NSMutableData array.
My question is, how do I display a PDF to a view when I have the NSMutableData array. I'd rather not save the file to disk if at all possible. I'm not dealing with very large PDF's. They would barely be 2 pages at most.
Ive seen a lot of info about displaying in a webview. Is a requirement? or just something people do?
Thanks

Unless you have a particular requirement to use NSMutableData array then have a look at VFR reader it's a powerful PDF reader and nice and easy to implement.
You can either access a locally stored PDF or use one from a web site.
VFR Reader

Related

iOS Fill use app data (strings, ints, images, etc) to fill out a pdf form and email it

So I've got this idea for a project and am looking for some solutions on how to complete it. Right now I have an iphone app set up to take in a bunch of user information and an image of a signature they draw. I have a pdf waiver that needs to be populated with this data and the signature. Is there any way to overlay this data on the form? Is there a way to create an html document with the form as the background and then the data laid over the top with css?
If this is possible, then what's the best way to get that new pdf or html page to a website/folder/email.
Would appreciate any help with that. Thanks!
For reference and theoretical explanations.. you can check Apple page https://developer.apple.com/library/ios/#documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_pdf/dq_pdf.html
Some nice tutorials:
http://www.raywenderlich.com/6581/how-to-create-a-pdf-with-quartz-2d-in-ios-5-tutorial-part-1
http://www.ioslearner.com/convert-html-uiwebview-pdf-iphone-ipad/
http://www.ioslearner.com/generate-pdf-programmatically-iphoneipad/

editing pdf contents in uiwebview iphone

hi im working on pdf manipulation.
my requirements are to edit the existing pdf document.
looks like there is no actual way to do it. i found out using javascript i can edit the html contents.
so now that my pdf is in uiwebview is there any way to convert pdf document to html content???
i have to do it programatically.
preferred language is objective c but its k if any suggestions in C/C++
thanks in advance
You will have to drop down to C if you want to do this. Basically you need to get hold of a CGPDFDocumentRef reference, and through that iterate each CGPDFPageRef. From the page you can get access to the CGPDFContentStreamRef.
From the content stream you can parse out the primitive data that is is PDF document. From there only a good understanding of the PDF document format can help you.
I would advice you to find a commercial tool, hire an experience contractor, or change your plan. What you have your sights on is allot of hard work.

What is the most elegant way to view a multipage PDF in iOS application?

I am stuck in a predicament whereby I hope someone can help me.
I am consuming a web service that returns a multi page PDF document as a Base64 payload. I want to be able to view the PDF on a page by page basis. For example I get the following string back in a long Base 64 encoded form within image tags :
<image>JVBERi0xLjMNCiXi48/TDQoxIDAgb2JqDQo8PA0KL01vZER........</image>
I am not wanting to use a UIWebView to view the fax but a simple very basic PDF viewer with pagination. I know there are some libraries like Fast PDF Kit but that would not work because they show the logo and the license is a little pricey.
I am a PDF newbie so if someone can show by a small example I would truly appreciate that.
I'm not sure why you don't want to use UIWebView since it probably does everything you need. PDF parsing guide from Apple will show you how to implement this by hand:
http://developer.apple.com/library/mac/#documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_pdf_scan/dq_pdf_scan.html

Displaying content from an RSS feed in an iphone app

I have seen some tutorials on the subject, but they all go half into it and then leave a person wondering.
How can I stream an rss feed into an iphone app.
I know the xml should be read in, parsed etc.
But then I am not sure how to display the information I need like, images, embedded videos etc.
If someone could just point me in the right direction I would be extremely grateful.
Thanks in advance
First, you need some type of XML parser. You can use the built in NSXMLParser or a slew of other parsers that you will need to download. Each have their pros/cons depending on what type of reading/writing you will be doing with your RSS feed.
To display the data, I would recommend a tableView. You can create custom UITablvewCells for each cell to hold the data however you want to display it. There are several tutorials available for that if you want to Google for it.
As for data, read all the RSS data into an array you create and have the tableView access that array.
Again, there are many online tutorials for this already but it seems like you need help with displaying the data. A quick Google lookup for how to create custom UITableViewCells should provide you lots of helpful links. Good luck.

Drawing a PDF full of formatted text with images on the iPhone

Is it possible to create a page with formatted text that is stored in core data. The text would need to be displayed with paragraphs and a few images. I have already written the code to create a PDF with one line of text, but I am unsure of the pattern needed to layout the PDF in a nice document way. One of reasons is I had to write the code in C. The data that will be in the document is of course In core data. And I do not know what the best practice is for what I am trying to do.
Unless you have a particular need for PDF, the best practice is to use HTML and UIWebView. WebView is the primary formatted-text displayer for iPhone. iPhoneOS 3.2 added CoreText, which is another option if you have serious layout needs, but it generally isn't needed for simple formatted text and data.
The Text and Web Programming Guide includes a good discussion of your formatting and layout options. Generally UIWebView is still your best bet.
I am quite sure NSData (your c bytes) could be stored in NSManagedObject.
Even if not. Why don't store only metadata in CoreData? Is much more simpler for example: info needed to render the page wanted, etc.
I am not sure archiving the hole PDF in CoreData is a good approach.