2

Is it possible to Edit PDF that is not Forms Fillable in C#

Details :

  1. An Existing PDF contains Images, Tables filled with Data and Text.

  2. Already tried itextsharp but couldn't able to identify any AcroFields to Manipulate the data.

  3. When tried to OCR using Nitro PDF, got Error : OCR cannot be done, since this page contains Editable / Searchable Contents

***Sample_Text Replace using ASPOSE***... This is the output from ASPOSE Text Replacement ... tried to Replace Word April with June

Requirement :

Have to edit the Text and Data Filled in Tables Programatically and Save it.

lollol
  • 95
  • 1
  • 2
  • 13
  • I did something similar, as it is now it only works with text, but if you provide an example PDF i could try to tweak it a bit if needed, the idea is getting words/sentences with locations then using blank rectangles to erase these words/sentences, then we could add different text (same size) over those locations. This approach uses the OverContent layer. I added a link to my project (VB.NET 2010) in a thread in iTextSharp FAQs under the name "how to highlight a text or word in a pdf file using iTextsharp?". If something like this would help just show an example PDF and i'll see what i can do. – Jcis Jun 29 '12 at 10:19

1 Answers1

0

If a commercial library is an option for you, you could try with Amyuni PDF Creator .Net. The method GetObjectsInRectangle will allow you to enumerate all the elements in the specified rectangle, you can then inspect the object type, and if it is a text object and it contains the text that you want you can replace it by assigning a new value to the Text attribute. Be aware that the rest of the text on your page will not be re-adjusted, so the new text must fit in the same space that the previous text was taking.

yms
  • 10,361
  • 3
  • 38
  • 68