有一个问题:获取 PDF 中的引用。然后获取转发链接所在的页码。并将此链接向前移动 10 页(例如,指向第 5 页的链接,这是必要的,它是第 15 页)。我得到了一个 Destination 数组,但是如何取出页码并更改它,我不知道。请告诉我!代码是:`
Reader:=New iTextSharp.text.pdf.PdfReader(OutFileName);
PageCount:=Reader.NumberOfPages;
For i:=1 To PageCount Do
PageDictionary:=Reader.GetPageN(i);
If PageDictionary.Contains(iTextSharp.text.pdf.PdfName.ANNOTS) Then
annots := PageDictionary.GetAsArray(iTextSharp.text.pdf.PdfName.Annots );
For Each A In Annots.ArrayList Do
AnnotationDictionary:= iTextSharp.text.pdf.PdfReader.GetPdfObject(A) As
iTextSharp.text.pdf.PdfDictionary;
////Make sure this AnnotationDictionary has a LINK and ACTION////
If (AnnotationDictionary.@Get(iTextSharp.text.pdf.PdfName.SUBTY PE).Equals(iTextSharp.text.pdf.PdfName.LINK))
And (AnnotationDictionary.@Get(iTextSharp.text.pdf.PdfName.A)<>N ull)
Then
////Get the Action ////
AnnotationAction:= AnnotationDictionary.GetAsDict(iTextSharp.text.pdf.PdfName.A );
////Get the Destination////
Dest_Array:=AnnotationAction.GetAsArray(iTextSharp.text.pdf. PdfName.D);
End If;
End For;
End If;
End For;
`