Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Getting Subject and Keywords into PDFAttribute dictionary



Hi,

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.

--Kahlil Gibran
-----------------------------------------------------------



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.