我試圖找出死書籤和PDF上的鏈接,爲此我將所有命名的目的地存儲在字典中,並試圖存儲目標頁面,以便我可以驗證其有效頁面還是不是?我正在嘗試這樣的..命名目的地到目標頁碼
For Each named As KeyValuePair(Of String, PdfObject) In reader.GetNamedDestinationFromStrings()
If Not namedDestinations.ContainsKey(named.Key) Then
namedDestinations.Add(named.Key, named.Value)
Dim thisDest As PdfArray = DirectCast(named.Value, PdfArray)
Dim a As PdfIndirectReference = DirectCast(thisDest(0), PdfIndirectReference)
Dim thisPage As PdfDictionary = PdfReader.GetPdfObject(a)
End If
Next
這段代碼我從其他線程複製,我需要趕上頁碼。否則我們是否有其他方法來驗證死鏈接和書籤。
我假設你複製了一些代碼而不知道它是關於什麼的。因此,閱讀你的問題的人不知道你想達到什麼目的。我們可以閱讀你的問題,但代碼片段似乎與問題無關。 –
http://stackoverflow.com/questions/10315797/how-do-i-get-section-target-page-number-in-pdf-file-using-itextsharp,我讀這個論壇從註釋中找到目標頁面,同樣我適用於套件我的程序...,沒有線索如何從本頁達到頁碼..,這是我的問題.. – arivu
對於k作爲整數= 1對於reader.NumberOfPages 如果thisPage.Equals(讀者.GetPageN(k))然後 msgbox k 退出 結束如果 Next',如果我使用此代碼我可以捕獲頁碼,但我們有任何其他直接的方法來獲取頁碼.. – arivu