benwiggy
benwiggy

Reputation: 2729

How to get CGPDFDictionary Keys

There is a question about using Swift to get the dictionary keys from a PDF file here: How to get CGPDFDictionaryRef keys

An answer has been given, which is just one line of code, but I don't see how it fits with the original code in the question. Can anyone elaborate it?

Upvotes: 0

Views: 276

Answers (1)

benwiggy
benwiggy

Reputation: 2729

Ah, yes, thanks. The line in the answer replaces the entire original code.

    CGPDFDictionaryApplyFunction(cat, { (key, object, info) -> Void in
        print("\(key), \(object), \(info)")
    }, nil)

However, I'm still getting a bunch of hex digits, rather than actual data. But it's a step in the right direction.

Upvotes: 0

Related Questions