How can I edit PDF files in an iOS application?

12,286

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.

Share:
12,286
cancerian
Author by

cancerian

Updated on July 18, 2022

Comments

  • cancerian
    cancerian almost 2 years

    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?

  • cancerian
    cancerian almost 13 years
    hi thanks for the reply. even i thought about it. my idea is show a pdf and when the user wants to edit the pdf i wil convert it to a text file and once editin s done i have save back as a pdf. not sure if this will work. any suggestions abt it???
  • Yuji
    Yuji almost 13 years
    In my opinion, using text fields and buttons would be better than just converting PDF into a text file. for example, having a text field for a patient's name, etc.
  • Mayuri R Talaviya
    Mayuri R Talaviya about 10 years
    I am want to replace my PDF text & save it again. Is there any other options for Edit PDF? so i can no need to recreate new PDF.