Pdf modification on iOS - ios

I am looking to be able to open a pdf file (done) and then be able to use the touch screen to sign the pdf and then save it with the modification. From what i have read this is no easy task, and i have no idea where to begin. Any of you know any tutorials or frameworks that will help me with this ?
Also if possible being able to modify fields of a pdf file, on the desktop the pdf can have fields you can click on then type in to fill out the form, without the need to ever print. If this is possible as well that would be perfect.
Thanks.

Maybe libHaru (http://libharu.org/wiki/Main_Page) does what you want, it's worth a try.

Does your starting point have to be a PDF? steipete's suggestion of using a system to create the PDF would work if your app workflow could create the PDF (sans signature) and display it, the user "signs" it in your app, and you create the PDF again this time with the signature embedded. It depends on whether this flow is an option for your app. Often it seems easier if you treat PDF as a final document and produce the PDF in it's final form each time (final meaning that you're not going to try modifying it).

Related

Editing a PDF in UIDocumentInteractionController and saving..?

I've got an 'interactive PDF' that I need to be able to edit and save in an iOS app and I'm looking at how to achieve it. It's got text boxes and radio buttons which I can interact with in the UIDocumentInteractionController preview (or QLPreviewController) but there doesn't seem to be a way to save those changes to the file that was loaded and if I share the live and edited file to my mac via AirDrop it doesn't send the changes, rather it seems just the original file.
I don't really know anything about interactive PDFs so not sure how added text would normally be saved. I've found that the 'Files' app (added in iOS 11) actually saves the edits you make, so that's basically what I want to be able to do.
At the end of the day I just need a way to be able to interact with a PDF in my app and save the changes. Do I maybe need to use a custom PDF viewer rather than trying to piggy back off the standard iOS file previewer functionality?
Looks like this library solves my problem: https://github.com/derekblair/ILPDFKit
It lets you edit a PDF, access and set individual fields and save out as a static PDF.

Draw signature over PDF file

I have an app in which some PDF files are downloaded and my problem is simple : I need to have the ability to sign them (drawing signature on screen) anywhere and save it to PDF format without modifying the structure of my PDF file.
The new feature in iOS 9 : Markup in the mail app does EXACTLY what I need. However, I don't want to use Mail in my app...
I've found on the web some ways to Generate PDF content, but very few examples and nothing that could help me with my problem.
Opening a PDF, turning it into NSData, create a context to render the signature then render both the PDF and the layered signature to finally save the NSData to PDF seems to be a pain, isn't it ?
Can someone help me either
Use markup features without using mail app or use it as transparent as possible for the user
Or, any reliable tutorial to draw signature over PDF without using a third-party app ?
Thank you,

Add-on for Submitting File from Clipboard

Is There A Browser-Add-on That Can Create A Temporary Txt File From My Clipboard And Populate The File Submit Dialog?
Guide for firefox:
Get the data from your clipboard with this: paste data from clipboard using document.execCommand("paste"); within firefox extension
Now you can either create a temporary file with something like OS.File: https://developer.mozilla.org/en-US/docs/JavaScript_OS.File/OS.File_for_the_main_thread
Or create a object with something like window.createObjectUrl.
Then assuming the file submit dialog is prompted by a html5 uploader, then you should just set value of that html5 dialog box there are other ways though too, like mozSetDataAt, mozSetFileArray etc, search github for these keywords shows excellent examples:
https://github.com/search?l=javascript&q=mozSetDataAt&type=Code&utf8=%E2%9C%93
https://github.com/search?l=javascript&q=mozSetFileArray&ref=searchresults&type=Code&utf8=%E2%9C%93
You might need to use the mimeType of application/x-moz-file not sure. Definitely experiement with it and share your solution, and ask for help along the way. This is fun stuff.
There are probably other smarter ways to attach into a input type=file, i was trying to do it the other week. I would also be interested if someone else could share some solutions to actually trick the file input element to think the native file dialog was actually used, maybe using XPCOM.

What is the best way to manipulate an existing PDF-Document under iOS?

I need to individualize documents within an iOS-App. I could provide the origin-documents as DOCX, PDF, PPT etc. The output-format has to be PDF.
My minimun requirement is to fill some text-fields. Nice to have would be to replace an image, too.
I´m quite used to generate PDFs programmatically using UIGraphicsBeginPDFContextToFile etc. But in my current case I don´t want to create the whole document programmatically, I just want to replace some content.
Any hints / tipps?
Thank you in advance.
DOCX is a zip - format file so you can process the contents programmatically and the reconstruct the zip file. PPT is a binary format though newer versions of PowerPoint might also construct zip-oriented versions that you can programmatically process. You mentioned though that you need don't want to programmatically process these documents - which I would probably also do only as a last resort.
For your DOCX origin/source documents (or doc,odt,rtf but not ppt/pdf) you could use Docmosis cloud services if your app can have the external dependency. You would upload your DOCX origin documents with placeholders for text-fields or images as a one-off/occasional task. Your iOS app then calls Docmosis sending instructions and data to create the output PDF and either stream it back to the app or email/store it or both.
The upside is it takes all the load and coding away from the iOS application (there is an SDK). The downside is it is an external depdendency. Please note I work for the company the created Docmosis.
Hope that helps.
Why not just load a page in a webView modal that points to a URL of a page you create? The main parts of the page would be static, and then the fields you need to customize would be populated via Javascript or PHP.
For example, we have a contact form in our app that gives you an option to view the details of your completed form after you submit. When the user clicks on the button to view the Contact Confirmation, it loads example.com/confirmation.php in a modal view within the iOS App.
On the confirmation.php page (on the web), I use PHP to pull in $_GET variables from the URL parameters which then populates the page with my static content, and their customized information that they entered into the form.

PDF generation in XCode

I am a newbie in iPhone development. I am planning to do a PDF application for iPhone. The functionality is:
User will type their input in a text field (which is going to be the content of the PDF file).
I have to modify the PDF file through code while saving (paragraphs, tables, bullets etc).
User can save it in their own name.
User can send the PDF file as attachment of MFMailComposer.
So I have searched and got many links. However I didn't find any leading details to create and modify a PDF file in iPhone/iPad.
Can anyone please provide me a good reference to do this. Are there any alternatives to do this?
I've used this reference: https://developer.apple.com/library/ios/#documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_pdf/dq_pdf.html
It contains theoretical explanations and source code examples
Please use the below link to download sample apps for PDF Reader/Viewer in iOS
PDF Reader/Viewer in iOS
Also please look at detail about pdf creation, manipulation etc in below links
developer.apple: PDF Document Creation, Viewing, and Transforming
Fast-and-lean-pdf-viewer-for-iphone
If you were doing a Phonegap app I'd say got for jsPDF, which would enable you to create (basic) PDF files in Javascript. I don't do Obj-C, but a quick look on SO provides good links.

Resources