When creating a CGPDFDocument I am having trouble providing values
for Subject and Keywords to the document's info dictionary.
There is no problem adding the Title and Author using code like this:
// Provide the document's author name
value = [[self documentAttributes] valueForKey:@"Author"];
if (value) { CFDictionarySetValue(info, kCGPDFContextAuthor,
(CFStringRef)value); }
But using similar code for the Subject (and Keywords)...
// Provide the document's subject
value = [[self documentAttributes] valueForKey:@"Subject"];
if (value) { CFDictionarySetValue(info, CFSTR("Subject"),
(CFStringRef)value); }
... when I later check the created PDF document's info dictionary the
value is not there.
I use CFSTR("Subject") rather than kCGPDFContextSubject because the
framework doesn't provide the constant, which would suggest that this
property is indeed not supported. Yet I find that a rather surprising
omission. The same goes for the Keywords property.
Is there a(nother) way to get these two properties into a
CGPDFDocument? (And it looks like I have to file an enhancement
request...)
Cheers,
António
-----------------------------------------------------------
And could you keep your heart in wonder
at the daily miracles of your life,
your pain would not seem less wondrous
than your joy.