• 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: How to print with a different NSPrintingOrientation for each page?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to print with a different NSPrintingOrientation for each page?


  • Subject: Re: How to print with a different NSPrintingOrientation for each page?
  • From: Schwill Daniel <email@hidden>
  • Date: Thu, 23 Aug 2007 18:43:36 +0200

Hello David,

On 21.08.2007, at 23:10, David Duncan wrote:

On Aug 18, 2007, at 1:23 AM, Schwill Daniel wrote:

When I start the NSPrintOperation with a printInfo with NSPortraitOrientation and transform the pages that are in NSLandscapeOrientation to fit the portrait orientation how will the resulting PDF look like, when I save it as PDF? I think that the pages with landscape orientation are rotated. Is this correct or will the PDF contain pages in portrait and in landscape orientation even when I transform the pages with landscape orientation to fit the portrait orientation of the used printInfo?

If you simply do a transform of the drawing context when you draw to the page, I would expect all pages to have the same orientation in the PDF, but the contents to be portrait or landscape (depending on your transform). That is like this:


_____
| | |
| | |
| V |
_____
|   |
|-->|
|   |
_____

(where the arrows show the direction of lines as you go down the page).

When the print operation goes directly to the printer I'm currently using a new print operation for each new orientation, but I will change this to use only one print operation and do a transform of the drawing context if needed. This way only one print job will be created instead of many print jobs when the orientation changes.


Is it possible to create a NSPrintOperation with different orientations for each page where the resulting PDF when saved as PDF contains pages in portrait and in landscape orientation?

I'm not certain honestly. If you need this level of control over PDF output, I would honestly generate the PDF yourself via either PDFKit of Quartz this way you can specify the page rect for each page yourself.

I already create a PDF this way for export as PDF and it work great. I also create a temporary PDF now when a workflow is selected in the Print Panel or the output should be saved as a PDF file.


I'm able to create a PDF with pages in portrait and landscape orientation, but I don't know how I can use this PDF in the further processing of the NSPrintOperation for example when the user choosed one of the PDF options in the NSPrintPanel for example Compress PDF or Mail PDF etc.?

You can use the Core Printing APIs (PrintCore.framework in ApplicationServices.framework). Look for the workflow options.

This work great to start the selected workflow from the Print Panel. Thanks a lot for the information!


Only one option is currently not working, in fact when the PDF should be saved as a PostScript file. I create the PDF with PDFKit and the PostScript file is created but I can not open this file with Preview, because I get a PostScript Conversation Error 'Couldn't convert the PostScript file to a PDF file.'. This work fine when I create the PDF with one print operation, but not when I create the PDF unsing PDFKit. Any hints why this doesn't work when the PDF is created using PDFKit?

Regards,

   Daniel


_______________________________________________

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


  • Follow-Ups:
    • Re: How to print with a different NSPrintingOrientation for each page?
      • From: David Duncan <email@hidden>
References: 
 >How to print with a different NSPrintingOrientation for each page? (From: Schwill Daniel <email@hidden>)
 >Re: How to print with a different NSPrintingOrientation for each page? (From: David Duncan <email@hidden>)

  • Prev by Date: Re: Informing one class about another class's methods
  • Next by Date: Re: Series of sheets
  • Previous by thread: Re: How to print with a different NSPrintingOrientation for each page?
  • Next by thread: Re: How to print with a different NSPrintingOrientation for each page?
  • Index(es):
    • Date
    • Thread