2

How can I change a reference (link to anohter PDF file) to a hyperlink and set its URI for e.g. to google.com?

A hyperlink and a reference seems to be different objects or rather classes in the iTextSharp library. So there must be some type swichting for the refernce object.

With iTextSharp, I can easily change the URI of hyperlinks, which I found here. But this doesn't work for refernces.

And I didn't find a way to do this with the abcpdf library.

I would need some hints, snippets or a solution based on the usage of the iTextSharp or abcpdf (websupergoo) libraries.

Technical ASCII implementation of the reference and the link:

Reference:

55 0 obj<</F 56 0 R/S/Launch/NewWindow true>>
endobj
56 0 obj<</F(Testdokument_2.pdf)/Type/Filespec>>
endobj
57 0 obj<</Rect[65.0666 447.627 190.233 473.951]/Subtype/Link/BS<</S/S/W1/Type/Border>>/A 59 0 R/C[0.0 1.0 0.0]/H/I/Border[0 0 1]/Type/Annot>>
endobj

Link:

6 0 obj
<</Subtype/Link/Rect[68.6 643.86 93.312 669.3]/BS<</W 0>>/F 4/A<</Type/Action/S/URI/URI(http://www.bing.com/)>>/StructParent 1>>
endobj

Maybe this will help to understand the difference.

Community
  • 1
  • 1
Aykut Çevik
  • 2,060
  • 3
  • 20
  • 27
  • Normally, a hyperlink to a URL is implemented as a so-called URI Action. See PDF reference section 8.5.3. A reference to another PDF may be implemented in the exact same way. In order to know how the 'document reference' in your PDF is implemented it would help to have access to the PDF document. Can you describe clearly at what page and what text links to the PDF? After that I may be able to provide a more helpful answer. – Frank Rem Jul 02 '12 at 14:50
  • @FrankRem: I edited my question to provide some technical differences. Is this helpful for you? – Aykut Çevik Jul 03 '12 at 08:13
  • Did you ever figure out how to do this? I need to do the same thing. – Nick Olsen Jul 12 '13 at 03:56
  • No, didn't figure it out. – Aykut Çevik Jul 12 '13 at 14:56

0 Answers0