0

I'm trying to find out if a PDF has links/target/outline entries. I use code like this (Monotouch, but should be similar in ObjC):

public bool HasOutlineEntries()
{
    CGPDFDictionary oCatalogDic = oPdfDoc.GetCatalog ();
    CGPDFDictionary oOutlinesDic = null;

    oCatalogDic.GetDictionary ("Outlines", out oOutlinesDic);
    if(oOutlinesDic != null && oOutlinesDic.Count > 0)
    {
        return true;
    }
    return false;
}

Unfortunately this always returns true even if the document does not have any (visible) entries. (oOutlinesDic.Count will be 2). When I get the details of the entries in the dictionary I always find two entries without name and description and an unknown target.

Is there a better way to find what I'm looking for? Or should I always just subtract 2?

Krumelur
  • 32,180
  • 27
  • 124
  • 263
  • Did you try substracting two? If it works, it may be a workaround solution. –  Apr 28 '12 at 20:40
  • I know...but I wonder what the two are. Could it be that these are the "Next" and "First" entries of the dcitionary? – Krumelur Apr 29 '12 at 17:40

0 Answers0