Printing : how to force paper format ?

  • Hi guys,

    Is there a way to force the paper format when printing a view ? I've
    tried NSStringInfo setPaperName: and it doesn't work :

    - (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)
    frame
    {
    NSLog (@"didFinishLoadForFrame");

    // ...

    NSPrintInfo * printInfo = [NSPrintInfo sharedPrintInfo];

    //[printInfo setPaperName:@"A5"]; // Doesn't work, let's try to set
    the dictionary :

    [[printInfo dictionary] setValue:@"A5" forKey:NSPrintPaperName];

    NSLog (@"paperName = %@", [printInfo paperName]);
    NSLog (@"localizedPaperName = %@", [printInfo localizedPaperName]);


    [[[[sender mainFrame] frameView] documentView] print:self];
    }

    paperName is still equal to "iso-a4" and localizedPaperName to "A4".
    And of course, my report is printed using A4 format.

    Am I doing something wrong ?

    Thanks,

    Eric.
previous month september 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
Go to today