Hi.
I'm using iTextSharp and i'd like to replace a page (in a different PDF)
with a new one preserving the links.
These links are external.
After having the page replaced by PdfStamper.ReplacePage(ReaderPg, Da, A)
I'm using this code to get my links
Dim Ar As ArrayList
Dim Annot As PdfAnnotation
Ar = ReaderPg.GetLinks(Da)
For Each lnk As PdfAnnotation.PdfImportedLink In Ar
Dim azione As PdfObject
Dim Uri As PdfDictionary
Annot = lnk.CreateAnnotation(PdfStamper.Writer)
azione = Annot.Get(PdfName.A)
If Not IsNothing(azione) Then
Dim Jdfy As PdfObject
Dim PDfN As New PdfName("JDFY_MyLookupKey3Enc")
Uri = PdfReader.GetPdfObjectRelease(azione)
If Uri.Contains(PDfN) Then
Jdfy = Uri.Get(PDfN)
End If
If Uri.Contains(PdfName.S) Then
Jdfy = Uri.Get(PdfName.S)
End If
End If
PdfStamper.AddAnnotation(Annot, A)
Next
The problem is that the destination links (generated by AddAnnotation) are
incorrect , as you can see in this picture:
http://www.sygest.it/upgrade/itext/pg11.jpg Page11
The dictionary in Old Links is the old link present in the old replaced page
(so ReplacePage can't remove links on destination page ? :confused:).
New Links are different in dictionary : Why ? Is this the correct way to
transfer my links ?
The page is visible at : http://www.sygest.it/upgrade/itext/PG11.pdf
TestPDF
Thank you
--
View this message in context:
http://old.nabble.com/PdfStamper.ReplacePage-and-Links-tp26215757p26215757.html
Sent from the iText - General mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://www.1t3xt.com/docs/book.php
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/