Michael Birkenmaier wrote:
> I'd like to read an existing PDF file with Java and iText.

Reading is a broad description.
You can use iText to extract text that isn't part of raster data.

> During this action I'll search for a specific string e.g. 'LinkTarget' (and 
> save the page number in a variable).

You could search the String that is the result of text extraction for a 
specific word.

> In a second step I want to add a link to a specific word ('LinkSource') in 
> the PDF document
> and 'convert' it to a link, which points to the 'LinkTarget'.

Finding the position of that String can be easy or difficult, depending 
on the way the PDF was created. As soon as you receive chapter 15, you 
should experiment with the RenderListener interface and experiment with 
the TextRenderInfo that is passed to that listener. TextRenderInfo gives 
you information about the location of Strings.

> Are the following steps supported by iText?:
> - Search for a word in the PDF document (and save the page number in a 
> variable).

You need text extraction for that (chapter 15).

> - Convert a word in the PDF to a link.

Finding the coordinates of that word will demand some programming work.
Adding a link on those coordinates is explained in chapter 7 (adding an 
annotation to an existing document).
-- 
This answer is provided by 1T3XT BVBA
http://www.1t3xt.com/ - http://www.1t3xt.info

------------------------------------------------------------------------------
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Reply via email to