Amagrammer
Amagrammer

Reputation: 6373

iPhone: How do I get the title of a PDF document from within the document?

Assuming I have extracted the CGPDFDictionaryRef from a PDF document using the iPhone SDK, how do I get the document's title from the dictionary? More generally, how can I get a list of the keywords for that dictionary? In theory I could ask the customer, but surely there must be some canonical keywords? Is there a list somewhere?

Update: I found this link which gives the common keys. To answer my own question, you can look these up directly in the dictionary returned by CGPDFDocumentGetInfo(pdfDocumentRef).

Upvotes: 2

Views: 1117

Answers (1)

Shaggy Frog
Shaggy Frog

Reputation: 27601

The dictionary key you're looking for is kCGPDFContextTitle.

Here's your list of keys.

Edit: I'm not sure. I haven't actually used CGPDF -- was just giving an educated guess based on how other Apple frameworks work.

Upvotes: 1

Related Questions