Document Attributes into Pdf
Document Attributes into Pdf
- Subject: Document Attributes into Pdf
- From: "Gerriet M. Denkmann" <email@hidden>
- Date: Thu, 17 Sep 2009 11:12:37 +0700
I read some text via:
NSTextStorage *textStorage = [textView textStorage];
NSDictionary *documentAttributes;
BOOL ok = [textStorage readFromURL:url options:nil documentAttributes:
& documentAttributes error: NULL];
Then I print it like this:
NSPrintInfo *printInfo = [ self printInfo ];
[ printInfo setJobDisposition: NSPrintSaveJob ];
NSMutableDictionary *dictionary = [ printInfo dictionary ];
[ dictionary setObject: somePath forKey: NSPrintSavePath ];
[ dictionary setObject: [ NSNumber numberWithBool: YES ] forKey:
NSPrintAllPages ];
NSPrintOperation *po = [ NSPrintOperation printOperationWithView:
textView printInfo: printInfo ];
[ po setShowsPrintPanel: NO ];
[ po setCanSpawnSeparateThread: NO ];
[ po runOperationModalForWindow: [ textView window ]
delegate: self
didRunSelector: @selector
( printOperationDidRun:success:contextInfo: )
contextInfo: NULL
];
Now, the resulting pdf has attributes similar to my
"documentAttributes" (like Author, Keywords, etc.) but the contents
(the values for these keys) are completely unrelated.
Question: how do I tell somebody who knows how to convert an
NSTextView into a Pdf to use my "documentAttributes" instead of some
defaults?
Kind regards,
Gerriet.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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:
This email sent to email@hidden