how to print webview

Discussion in 'iOS Apps' started by hnuyx, Aug 17, 2011.

  1. hnuyx

    hnuyx New Member

    Aug 16, 2011
    1
    0
    0
    in my IB, i have a NSWebView * webView;

    i want to print it and did like this:
    [webView setMainFrameURL: @"/tmp/test.html"];

    NSView *view = [[[webView mainFrame] frameView] documentView];
    [view print: self];


    my controller class inherits the NSObject, the above code is contained in a method of my class and the method is linked to IB, the webView mentioned in the above code is also linked to the IB's WebView.

    then, when i click the button in the IB, it opens the print panel.

    i can save it in a pdf file(because i have not a printer), but when i set the layout in the print panel, it will save error and output the error information in the console:
    printing failed because PMSessionEndDocumentNoDialog() returned 1030

    how can i do to modified this error.


    apologies if this is the wrong list for this question.
     

Share This Page