• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Document Attributes into Pdf
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: How to create subentity object inheriting from superentity object in core data
  • Next by Date: Re: NSString vs. encoding
  • Previous by thread: Re: #pragma to suppress a warning message
  • Next by thread: re: How to create subentity object inheriting from superentity object in core data
  • Index(es):
    • Date
    • Thread