0

I'm using iTextSharp to interact with multi-layered PDF files from C# (VS2012). the PDF file is kind of a map, with plots on one layer and text on another. what I want to do is, give the PDF path and layer name (the layer which has text) to application, it will search for text on the layer and create external hyperlinks on text. (I have a Dictionary with words and links). I'm able to open the PDF, read how many pages it has, and also find the required layer. But I'm kind of stuck and unable to find how to do next things i.e. read text on found layer and create hyperlinks. Please guide me. Thanks.

zeeshan
  • 43
  • 1
  • 4
  • http://stackoverflow.com/questions/2550796/reading-pdf-content-with-itextsharp-dll-in-vb-net-or-c-sharp – luke2012 Oct 03 '13 at 05:13
  • I have to read and create hyperlink on a specific layer, would I follow the same path as reading text from a simple pdf? – zeeshan Oct 03 '13 at 05:16
  • In theory you can read in the text on the specific layer then insert a hyperlink (link example - http://www.mikesdotnetting.com/Article/84/iTextSharp-Links-and-Bookmarks) Never tried this before so you will need to play around a bit. – luke2012 Oct 03 '13 at 05:22
  • I spent a while looking through the source and it appears there isn't an easy way to get what you're looking for, specifically "Get text from page N on layer Y". The layers are called optional content from a PDF perspective and iText is aware of them and handles them correctly but it doesn't seem to have any public properties stating "this is the current layer". If you're comfortable editing the source of iTextSharp I'd take a look at `iTextSharp.text.pdf.parser.PdfContentStreamProcessor`. Also, if this is a feature that you really need iText has paid support: http://itextpdf.com/support – Chris Haas Oct 03 '13 at 18:55

0 Answers0