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 protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to