Export form data on iPad into printable PDF - ios

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

Related

iOS: Create dynamic contracts with iOS

I want to create a native ios application where people have to sign different contracts. Each contract contains text and input fields such as drop down and textbox. Now each contract might have different number of input fields and these might be totally different.
Any input in the best way to solve this problem? It seems like a lot of work to dynamically generate UI in code and reformat the contracts in a way that can be rendered by ios? As I cant send the pdf or doc itself.
One solution may be you can have categories(sector-1,sector-2 etc) and related sample contract from. In those sample forms you can handle dynamic controls which definitely a few.

How to edit PDF Forms in iOS application?

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!

iOS display partial download of pdf, only first page

Is it possible to display a pdf from a partial download?
I need only the first page of a pdf for my app. The problem is all the PDF online are 25mb or more in size. Optimizing for the app is not an option :(
The entire PDF will need to be downloaded to display and save it, but I want to show a preview first.
A similar question, but for android:
How to Display first page of PDF before downloading is completed
I do understand downloading of data in iOS, but how can I tell where in the PDF's data the page ends, so I can just display that.
Yes you can do this but the PDF needs to be pre-constructed in a linearized format. This is something that is part of the PDF specfication and is sometimes known as fast-web-view.
Linearized PDF is the same as normal PDF but the objects in the document are ordered in a particular way and with certain extra information which makes it possible to work with partial data.
In particular the objects for the first page are included at the start of the file specifically so that the first page can be displayed quickly.
So I see no reason you shouldn't download the objects at the start of the PDF and use those to display the first page. You could use the hint tables for fast access to selected other pages but that would be quite complicated.
However the essence is that you need to pick up the group-one objects for the first page. These should run from the "%PDF" header through to the first "%%EOF". I'm not sure whether your environment will complain about the missing (but not required) objects but if it does you will need to blank them out on a binary level so that you have an internally consistent page one PDF.
For full details on PDF linearization see the Adobe PDF Specification.
My answers may feature concepts based around ABCpdf .NET. It's what I work on. It's what I know. :-)

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

Issues with Filemaker IWP working with hyperlinks on images

I have a filemaker database that I need to be able to link records and all associated data (including container field data) to various points placed on a large PDF image, and then make that data appear via instant web publishing when someone clicks on the marker for that area on the PDF. For example the PDF may be an image of a car, and then I would have various close up images of issues with the car and descriptions of those images as records in the database. I would then want to drop points on the base PDF image and when you clicked on those points be able to see the close up images and other data related to those images.
I'm being told this is too much for IWP because:
I need to place the markers outside filemaker via PDF annotation
Filemaker IWP can't handle the number of markers that may be necessary (it could be up to 1,000 on an E sized image.
Does anyone have a work around or explanation why this is a problem?
If I understand correctly, you would like to setup a PDF with links that will open a browser and show data related to what was clicked. Assuming that is the case, the reason this wont work is because IWP does not provide a unique URL for a unique page. For example, here on StackOverflow you can directly link to any question based on its URL:
http://stackoverflow.com/questions/3207775/ -- this question
http://stackoverflow.com/questions/4973921/ -- some other question
IWP uses Javascript and session variables to manipulate the output to the screen, so there is no way to link to a specific section of your IWP site, since the URL is always something like:
http://yoursite.com/fmi/iwp/cgi?-db=YOUR_DB-loadframes -- Product A
http://yoursite.com/fmi/iwp/cgi?-db=YOUR_DB-loadframes -- Product B
http://yoursite.com/fmi/iwp/cgi?-db=YOUR_DB-loadframes -- Product C
Because of the limited nature of IWP, you will not be able to workaround this issue. You'll need to build your own web-interface using the Custom Web Publishing Engine, either using the built-in PHP extensions or some other technology where you invoke the XML publishing API.
I agree with Nate
IWP is the wrong solution to this problem. You'd be better off simply hosting those images on a webserver.
Now here comes the plug, you can use SuperContainer to really simplify the management of the images from FileMaker.

Resources