tags:

views:

459

answers:

3

I have a pdf file.I need to find all the hyperlinks available in that file and then make change on those links. I am using C# and I'd rather not to use a third party tool!

A: 

You might want to look at ActivePDF and PDFTron

Lou Franco
A: 

Personally I'd have a hack around with PyPDF..

Jon Cage
+2  A: 

You can use iTextSharp. Its an open-source API to manipulate pdf written in c#.

The basic algorithm would be:

  1. Loop through every pages in the PDF file.
  2. For every page, loop through every annotation in the annotations collection (annots dictionary).
  3. If you found an annotation of subtype link, increases your count or do whatever logic you need to do.

RWendi

RWendi
I am having a hard time figureing out the API. Shoud I do something like this:PdfReader reader = new PdfReader("c:\\sample2.pdf");PdfDictionary dic = reader.GetPageN(1);
Houda