NSPrintInfo will not accept paper format wider than high?

  • Hi all,

    From a Cocoa application I need to print to a RIP that expects

    NSPaperSize = NSSize: {2088, 1570.5};
    NSOrientation = 0;

    Note how the paper size is wider than it is high.

    When I use:

    NSPrintOperation *op=[NSPrintOperation printOperationWithView:self];
    NSPrintInfo  *printInfo=[op printInfo];

    [printInfo setPaperSize:NSMakeSize(2088, 1570.5)];
    [printInfo setOrientation:NSPortraitOrientation];

    I end up with:

    NSOrientation = 0;
        NSPaperSize = NSSize: {1570.5, 2088};

    Note how it swapped width and height.

    OK, so NSPrintInfo documentation for "setPaperSize:" claims:

    This method may change either the paper name or orientation for
    consistency.
    To avoid this side effect set the values in the dictionary directly.

    Fine, so I try:

    [[printInfo dictionary]setObject:[NSNumber
    numberWithInt:NSPortraitOrientation] forKey:NSPrintOrientation];
    [[printInfo dictionary]setObject:[NSValue
    valueWithSize:NSMakeSize(2088, 1570.5)] forKey:NSPrintPaperSize];

    But still:

    NSOrientation = 0;
    NSPaperSize = NSSize: {1570.5, 2088};

    Presumably that is a bug, I filed a report.

    But I still need that elusive

    NSPaperSize = NSSize: {2088, 1570.5};
    NSOrientation = 0;

    Any idea what to do?

    Thanks

    Gerd
  • >
    >
    > [printInfo setPaperSize:NSMakeSize(2088, 1570.5)];
    > [printInfo setOrientation:NSPortraitOrientation];
    >
    You are really trying to print a landscape image. But are using wrong
    orientation.
    Try using  'NSLandscapeOrientation' instead of 'NSPortraitOrientation'.

    > OK, so NSPrintInfo documentation for "setPaperSize:" claims:
    >
    > This method may change either the paper name or orientation for
    > consistency.
    Thats why you happen to see your width and height getting
    automatically swapped to
    fit the definition of the NSPortraitOrientation.  Portrait is called
    so because its width is less than equal
    to its height and the landscape vice versa.

    Regards
    Shripada
previous month december 2007 next month
MTWTFSS
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            
Go to today