how can i edit pdf files in an ios application

how can i edit pdf files in an ios application  using -'iphone,objective-c,ios,ipad,core-graphics'

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?

asked Sep 21, 2015 by kinnari
0 votes

1 Answer

0 votes

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 familar with the particular format of your pdf.). A dedicated UI would be much better.

answered Sep 21, 2015 by rajesh