Welcome Guest Search | Active Topics | Sign In | Register

Modify a text in a PDF file Options
rosariob
Posted: Monday, December 16, 2013 5:13:39 PM
Rank: Newbie
Groups: Member

Joined: 12/16/2013
Posts: 4
Hi
i have the need to modify some text line in a PDF File.
I suppose to load the document with ...

ManipulatePdf = New EO.Pdf.PdfDocument("C:\DOC777.pdf")

but i don't understand how to modify a text before saving the file with another name

Thanks
eo_support
Posted: Monday, December 16, 2013 5:27:37 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,196
Hi,

Unfortunately you won't be able to do that directly. A PDF page is very much like a wall that you can paint on. It is easy to add things to it but it is much more difficult to remove things. It is possible for you to add a white block to completely obscure an area of the page, then add new text onto it to make it "look like" you have replaced something, but you are really just adding things.

Both HTML to PDF converter and the PDF Creator interface can do this. With HTML to PDF converter, you can use a DIV with a solid white background, then put your text inside the DIV. You would then render that HTML to the page like this:

HtmlToPdf.ConvertHtml(your_html, ManipulatePdf.Pages[0]);

It's possible to control the HTML position with HtmlToPdf.Options. But it might be easier for you to control the output position inside your HTML.

You can also use the PDF creator interface to achieve similar result. You can take a look of the PDF creator documentation and samples to get an idea on how to use that. Using PDF creator is more code but it runs faster.

In both cases, you have to already known the exact location of the new text. Our API can not read your PDF file and give you location information about a specific text.

Hope this helps. Please feel free to let us know if you have any more questions.

Thanks!
rosariob
Posted: Tuesday, December 17, 2013 3:21:08 AM
Rank: Newbie
Groups: Member

Joined: 12/16/2013
Posts: 4
Hi
Thanks for the answer, it's now clearly about the difficulty to do this, but the solution could be valid.
Have you any example of how to add two objects (the block and the new text) ?
I could know the exact location of where add the two objects.

Thanks a lot!
eo_support
Posted: Tuesday, December 17, 2013 7:26:29 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,196
Hi,

Please take a look of the HTML to PDF converter and PDF Creator samples and documentation. There are plenty of samples for both interfaces that does what you need to do.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.