Re: NSPrintOperation Fails to Auto-Paginate?
Re: NSPrintOperation Fails to Auto-Paginate?
- Subject: Re: NSPrintOperation Fails to Auto-Paginate?
- From: Chaitanya Pandit <email@hidden>
- Date: Tue, 4 May 2010 16:35:33 +0530
Have a look at the TextEdit sample code in /Developer/Examples/TextEdit
The MultiPageView handles that
Thanks,
Chaitanya Pandit
Architect
Expersis Software Inc.
On May 3, 2010, at 9:33 PM, David Duncan wrote:
> On May 2, 2010, at 7:57 PM, DairyKnight wrote:
>
>> I've been working on a tool to print an NSView to a PDF file. I followed
>> Apple's documentation but couldn't get the auto-pagination work.
>> The resulting PDF file is always long and one-page. Hope someone with
>> relevant experience could help me. My code is as follows:
>
>
> PDFOperationWithView doesn't do pagination. Instead you need to set the job disposition to generate a file rather than to output to a printer. Something like this:
>
> NSDictionary *printInfoDictionary = [NSDictionary dictionaryWithObjectsAndKeys:
> NSPrintSaveJob, NSPrintJobDisposition,
> urlToSave, NSPrintJobSavingURL, // use NSPrintSavePath on 10.5 or below.
> [NSNumber numberWithBOOL:hideExtension], NSPrintJobSavingFileNameExtensionHidden, // only on 10.6 or above.
> nil];
> NSPrintInfo *printInfo = [[[NSPrintInfo alloc] initWithDictionary:printInfoDictionary] autorelease];
> NSPrintOperation *operation = [NSPrintOperation printOperationWithView:view printInfo:printInfo];
> --
> David Duncan
> Apple DTS Animation and Printing
>
> _______________________________________________
>
> 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
_______________________________________________
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