0

I know how to extract all marks I have added in my PdfDocument.
For that, I parse the document dictionnary:

for( int i=0; i < reader.XrefSize; i++) {           
  var obj = reader.GetPdfObject(i);
  if (obj != null && obj.GetType() == typeof(PdfDictionary) ) {
    PdfDictionary objDic = (iTextSharp.text.pdf.PdfDictionary) obj;

Now I can locate PdfName.DEST fields in these PdfDictionary:

if (objDic.Keys.Contains(PdfName.DEST) == true) {                       
  var next = objDic.Get(PdfName.DEST);
    if (next.GetType() == typeof(PdfArray)) {

But, how to convert this next in PdfDestination ?
And how to get the 'vertical position', and better the 'page number' in the document ?

Best regards.

maiagarbot
  • 147
  • 1
  • 2
  • 15
  • I don't know if this helps but [here's a much bigger example](http://stackoverflow.com/a/10321886/231316) of resolving destinations. – Chris Haas Jul 06 '16 at 15:10
  • The question is indeed incomplete. No distinction is made between *explicit destinations* (in which you get an indirect reference to a page dictionary) and *named destinations* (in which you get a name that refers to a page that is reference in a name tree containing references to pages). – Bruno Lowagie Jul 06 '16 at 15:12
  • I use PdfXChange Viewer for adding markers in Pdf file. I don't know if they are "named destination" or not. There is a text linked to. And ' reader.GetNamedDestinationFromStrings()' and 'reader.GetNamedDestinationFromNames()' return empty collections. – maiagarbot Jul 06 '16 at 15:18

0 Answers0