How to edit PDF Forms in iOS application? - ios

i have a lots of PDFs forms and i want to put them on iPad and fill them up, then send it by mail. how can i edit this pdf forms in an app? i am very new with xCode and i could use lots of suggestions ...
How can I edit PDF files in an iOS application?
i found this question durring my search and the idea presented here,
"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." .. sounds very good just that i dont know how to start ...
Thanks

Basically, what it's saying is create a nib/screen/front end to the PDF that would allow the user to record what data they want in there, then after that run a separate piece of code to write that data into the PDF!
Some links to help you out:
Quartz-2D Programming Guide (QuartzCore Framework): https://developer.apple.com/library/ios/documentation/graphicsimaging/conceptual/drawingwithquartz2d/dq_pdf/dq_pdf.html
A tutorial (Although aimed at iOS5)
http://www.raywenderlich.com/6581/how-to-create-a-pdf-with-quartz-2d-in-ios-5-tutorial-part-1
I will say, I can find information on GENERATING PDF files a lot easier/more reliably than editing them... Are the templates you have difficult? It may be worth re-creating them programatically when the data is inputted!

Related

Making an RSS news article page look "native" in ios app

I am creating an RSS Reader ios app for work and I have everything that I need except that when the article is loaded it just loads the mobile view just as it would load when viewing on safari. They want it to look more "native" to the app, meaning just the title, photo and then then the articles text in plain underneath.
This is my first attempt at an app and I am using a project that was open free source code. This project uses MWFeedParser integrated into it which, from what i've read, can accomplish what I need to (I think). Can anyone who has done this before or knows how to do it be kind enough to take me through it? I've asked a similar question before but the answers were vague and still left me stuck.
If it helps, I have uploaded the full project on github here:
https://github.com/cpoti24/RSSReader
Please download it if you wish and run it yourself on xcode if that will help out. If you're able to do it and help me learn how, even better.
Thanks!

iOS create PDF invoice

I want to create a PDF invoice inside my iOS App (either in Objective-C or Swift).
My main problem is that the invoice might have several pages, which is very difficult to realize with the existing APIs from Apple (CoreGraphics, Quartz 2D, etc).
By now, I already have a barely working solution:
I created a HTML template which is the basic structure for the invoice
The template is filled with data using GRMustache
I load the generated HTML file into a UIWebView and save it as PDF (I used NDHTMLtoPDF to do this)
So far, so good.
The problem with this solution is that page breaks don't work properly.
There are some tables and images and the page break often cut's off tables or images.
I have tried to use the page-break-inside: avoid; css property for the images and the tables but UIWebView seems to ignore them completely...
My question is:
Do you know how to fix the page break problem?
Can you recommend another solution to create PDFs on iOS?
Should I design the invoice in Storyboard and generate a PDF from the UIView? What about the page breaks here?
I would prefer to have a template (e.g. HTML), fill it with data and save it as PDF, rather than doing everything in code.
I actually wrote a PDF reporting component myself with presumably similar requirements:
templating is done via HTML / CSS
Static Header / Footer on each page
You can achieve this with UIPrintPageRenderer and UIViewPrintFormatter APIs, with the downside of probably getting your app rejected in the app store review, since you're using private Apple APIs. So this approach might only be viable in an academic setting or if your developing in-house apps.
There are some tutorials on how to do this which I'm not going to repeat, but for me these resources were quite useful:
http://www.fromdev.com/2014/06/how-to-create-a4-size-pdf-file-in-ios.html
http://www.labs.saachitech.com/2012/10/23/pdf-generation-using-uiprintpagerenderer/

How to implement an interactive PDF in iOS

Here im hitting my head againt the wall.
My client provided a pdf with buttons(just like buttons,when user tap on button,it will load next page and previous page etc.).
This buttons will work only when we open it in adobe reader.
I tried the QLpreviewview,quickview but it is not working,all what i can do is just to load the pdf in the webview.
Can anyone please help me in how to load an interactive pdf in iOS.
Thanks in advance.
Have a look at PSPDFKit, it is the most advanced framework I've found for PDFs in iOS. They have an impressive list of customers as well.
It is a bit pricy though, but you have the option to get the Source Code too if you need to modify anything. Could be worth it if your client need that kind of performance and other features as well.
(I am not in any way affiliated with PSPDFKit)
The limitations are due to the capabilities (or non-capabilities) of the PDF viewer used.
Currently the leading PDF viewer on iDevices is PDFExpert by Readdle. Adobe Reader for iDevices is weaker, but can deal to some extent with form elements.
For page navigation etc. you might use links instead of button fields (as far as you can live with the capabilities of links, and not use JavaScript). Links are said to be handled properly with many PDF viewers.
You may have to require certain PDF viewers on instructional level, because you don't have control over the viewer used by the actual user. And, as you noticed, many PDF viewers are simply too dumb do deal with active elements.
Another approach would be looking at PDF-to-HTML5 converters, and serve HTML5 from a server.

Let end users edit a pdf in rails?

I'm trying to find a way to let the client of a website I'm working on (specifically an administrator) edit the content of a pdf file. For example, if the client decides that they want to change the wording on a pdf (but not the format), they can click a button or something and make the changes they need to without asking me to do it. Any help would be much appreciated. :)
Check out The Ruby Toolbox page for report generation, specifically PDF_generation. There's a couple of different options with reviews and documentation.
https://www.ruby-toolbox.com/categories/pdf_generation

Export form data on iPad into printable PDF

I have an issue with "exporting" to PDF on an iPad.
My goal is, to take all the user data, a user has passed into the app for a form. The form itself is only available as a printed form, but I have the PDF as well. The thing is, after all the data has been given by the user, the output PDF I want to create for printing has to look completely like the printed version.
I have no idea of any "best practices" around how to accomplish this efficiently.
So my questions are:
Do I have to draw the form completely by myself and measure out all form field components on the printed form to draw them maybe with quartz2d?
Can I kind of parse the PDF I got already and read out all information to write a kind of script to transform the PDF into usable code?
What are best practices for filling out a form given in a paper version only to recreate the look of the original as close as possible? the look would be absolutely essential for the users of the app.
I do not have to read out form fields from the pdf. The only goal would be:
User taps on a print button in the app
from the user data provided by the app form a pdf should be created looking as close as possible compared to the printed version.
Thanks for any help on this
Sebastian
if you are doing this for iOS5 they check Ray's article
http://www.raywenderlich.com/6581/how-to-create-a-pdf-with-quartz-2d-in-ios-5-tutorial-part-1
http://www.raywenderlich.com/6818/how-to-create-a-pdf-with-quartz-2d-in-ios-5-tutorial-part-2

Resources