• 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
Re: NSPrintOperation Fails to Auto-Paginate?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >NSPrintOperation Fails to Auto-Paginate? (From: DairyKnight <email@hidden>)
 >Re: NSPrintOperation Fails to Auto-Paginate? (From: David Duncan <email@hidden>)

  • Prev by Date: Re: Core Data Versioning: Non-trivial Value Expressions?
  • Next by Date: NSTableView Loading Question
  • Previous by thread: Re: NSPrintOperation Fails to Auto-Paginate?
  • Next by thread: Re: Strange NSScroller sizing behaviour
  • Index(es):
    • Date
    • Thread