CGPDFDictionary keys

前端 未结 3 1284
鱼传尺愫
鱼传尺愫 2021-01-15 00:52

I\'m getting crazy, cause I cannot find what are the \"default\" keys you would have in a PDF Document.

For example, if I want to retrieve an hyperlink from a CGPDFD

相关标签:
3条回答
  • 2021-01-15 01:08

    It's absurd that you would have to go read 1300 page long specs just to find what keys a dictionary contains, a dictionary that could contain anything depending on what kind of annotation it is.

    To get a list of keys in a CGPDFDictionaryRef you do:

    // temporary C function to print out keys
    void printPDFKeys(const char *key, CGPDFObjectRef ob, void *info) { 
        NSLog(@"key = %s", key);
    }
    

    In the place where you're trying to see the contents:

    CGPDFDictionaryRef mysteriousDictionary; // this is your dictionary with keys
    CGPDFDictionaryApplyFunction(mysteriousDictionary, printPDFKeys, NULL);
    // break on or right after above, and you will have the list of keys NSLogged
    
    0 讨论(0)
  • 2021-01-15 01:17

    The Adobe PDF Reference describes all of the keys.

    0 讨论(0)
  • 2021-01-15 01:30

    The keys in a dictionary depend on the actual object the dictionary represents (a page dictionary has other keys than an annotation dictionary). The Adobe PDF reference describes all these objects and their keys.

    0 讨论(0)
提交回复
热议问题