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

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/

Related

How can I edit PDF files in an iOS application?

In my iPhone / iPad application, I show a person's medical reports in the form of a PDF. I have saved the reports in the documents directory and am reading them from there.
I want the user to be able to add or edit comments on these PDFs, as well as be able to highlight certain sections in the PDF. After editing, the application should be able to save the PDF back into the documents directory.
Is this possible within an iOS application? If so, how? Is this a task for Core Graphics?
Editing PDF directly on iPad/iPhone is a rather big job because the standard API only supports showing it (and only a bit more.) If you want to do anything more, you need to invest a huge amount of time to implement generic pdf handling code.
There is an open-source library handling these, e.g. this one. I don't know if it fits your needs, though.
A better idea, in my opinion, is to create a native UI showing the data contained in the PDF file using the standard Cocoa-Touch UIKit and create the PDF once the user is done with it so that the user can export it back. That way, you don't have to write a complicated PDF handling code.
In any case, it's not a good idea to show generic PDF on iPhone, because the screen size is so small (iPad is a different question, especially if you expect the user to be familiar with the particular format of your pdf.). A dedicated UI would be much better.

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

Converting data to PDF on iPad/iPhone

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.

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.