Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Mon Jun 14, 2021 9:48 am

Hi

I've just started trying out Spire - specifically the ability to get co-ordinates of specified text on a pdf - and have been impressed so far.

I currently have a need to find and replace text in a pdf supplied to me. It's essentially a letter that has a few fields like 'Dear XXX', so I have a vb.net program set up to look for the 'XXX' and replace with variable data from a csv file I read in.

Once I've got the co-ords of a specified word or phrase in a pdf, then I've been using itextsharp (which I'm more familiar with) to draw a white rectangle over the co-ord area to hide the text I'm replacing, then stamp the new text on top.

It all works OK, but I'm just wondering if there's a better way of doing this with Spire? - is there any facility for directly editing text in a pdf?

Is there also a way of changing the co-ordinates of existing text, so effectively moving it on the pdf? - this is another requirement I have which I have, which I do by stamping a white box over the existing text and then stamping new text elsewhere, so it's a similar issue for which I wonder if there's a better way?

Thanks

Ash_Precision2
 
Posts: 9
Joined: Mon Jun 14, 2021 9:17 am

Tue Jun 15, 2021 8:54 am

Hello,

Thanks for your inquiry.
Since all the contents of PDF are drawn on canvas, our Spire.PDF is not able to directly modify/edit the text. Therefore, our Spire.PDF can also only replace and move text using a solution similar to the one you mentioned. Sorry for the inconvenience caused.
If you have any other questions, please feel free to contact us.
Sincerely,
Andy
E-iceblue support team
User avatar

Andy.Zhou
 
Posts: 483
Joined: Mon Mar 29, 2021 3:03 am

Wed Jun 16, 2021 7:50 am

Thanks for your reply. This is no problem, just wanted to check I wasn't doing things the hard way!

Just having an easy way to get text co-ordinates with Spire is a big plus for me.

Ash_Precision2
 
Posts: 9
Joined: Mon Jun 14, 2021 9:17 am

Wed Jun 16, 2021 8:23 am

Hi,

Thanks for your response.
I am glad to hear your recognition of the feature of our Spire.PDF.
If you have any questions about our products, please feel free to contact us.
Sincerely,
Andy
E-iceblue support team
User avatar

Andy.Zhou
 
Posts: 483
Joined: Mon Mar 29, 2021 3:03 am

Return to Spire.PDF

cron