1.29 <WebKitPrintOperation>

Class: <WebKitPrintOperation>

It derives from <GObject>.

Controls a print operation.

A <WebKitPrintOperation> controls a print operation in WebKit. With a similar API to <GtkPrintOperation>, it lets you set the print settings with print-operation:set-print-settings or display the print dialog with print-operation:run-dialog.

Properties

Property: print-operation:page-setup self

The initial <GtkPageSetup> for the print operation.

Its value is a <GtkPageSetup>, or #f.

Set it with (set! (print-operation:page-setup self) value).

Property: print-operation:print-settings self

The initial <GtkPrintSettings> for the print operation.

Its value is a <GtkPrintSettings>, or #f.

Set it with (set! (print-operation:print-settings self) value).

Property: print-operation:web-view self

The <WebKitWebView> that will be printed.

Its value is a <WebKitWebView>, or #f.

It can only be set when the object is made, with #:web-view.

Procedures

Method: print-operation:get-page-setup self ⇒ %return
Method: get-page-setup self ⇒ %return

Return the current page setup of self.

It returns #f until either print-operation:set-page-setup or print-operation:run-dialog have been called.

self

Passed: a <WebKitPrintOperation>.

a <WebKitPrintOperation>

%return

Returned: a <GtkPageSetup>.

the current <GtkPageSetup> of self.

Method: print-operation:get-print-settings self ⇒ %return
Method: get-print-settings self ⇒ %return

Return the current print settings of self.

It returns #f until either print-operation:set-print-settings or print-operation:run-dialog have been called.

self

Passed: a <WebKitPrintOperation>.

a <WebKitPrintOperation>

%return

Returned: a <GtkPrintSettings>.

the current <GtkPrintSettings> of self.

Procedure: print-operation:new web-view ⇒ %return

Create a new <WebKitPrintOperation> to print web-view contents.

web-view

Passed: a <WebKitWebView>.

a <WebKitWebView>

%return

Returned: a <WebKitPrintOperation>.

a new <WebKitPrintOperation>.

Method: print-operation:print self
Method: print self

Start a print operation using current print settings and page setup.

Start a print operation using current print settings and page setup without showing the print dialog. If either print settings or page setup are not set with print-operation:set-print-settings and print-operation:set-page-setup, the default options will be used and the print job will be sent to the default printer. The print-operation:finished signal is emitted when the printing operation finishes. If an error occurs while printing the signal print-operation:failed is emitted before print-operation:finished.

If the app is running in a sandbox, this function only works if printing to a file that is in a location accessible to the sandbox, usually acquired through the File Chooser portal. This function will not work for physical printers when running in a sandbox.

self

Passed: a <WebKitPrintOperation>.

a <WebKitPrintOperation>

Method: print-operation:run-dialog self [parent] ⇒ %return
Method: run-dialog self [parent] ⇒ %return

Run the print dialog and start printing.

Run the print dialog and start printing using the options selected by the user. This method returns when the print dialog is closed. If the print dialog is cancelled cancel is returned. If the user clicks on the print button, print is returned and the print operation starts. In this case, the print-operation:finished signal is emitted when the operation finishes. If an error occurs while printing, the signal print-operation:failed is emitted before print-operation:finished. If the print dialog is not cancelled current print settings and page setup of self are updated with options selected by the user when Print button is pressed in print dialog. You can get the updated print settings and page setup by calling print-operation:get-print-settings and print-operation:get-page-setup after this method.

self

Passed: a <WebKitPrintOperation>.

a <WebKitPrintOperation>

parent

Passed, or left out: a <GtkWindow>, or #f.

transient parent of the print dialog

%return

Returned: a <WebKitPrintOperationResponse>.

the <WebKitPrintOperationResponse> of the print dialog

Method: print-operation:set-page-setup self page-setup
Method: set-page-setup self page-setup

Set the current page setup of self.

Current page setup is used for the initial values of the print dialog when print-operation:run-dialog is called.

self

Passed: a <WebKitPrintOperation>.

a <WebKitPrintOperation>

page-setup

Passed: a <GtkPageSetup>.

a <GtkPageSetup> to set

Method: print-operation:set-print-settings self print-settings
Method: set-print-settings self print-settings

Set the current print settings of self.

Set the current print settings of self. Current print settings are used for the initial values of the print dialog when print-operation:run-dialog is called.

self

Passed: a <WebKitPrintOperation>.

a <WebKitPrintOperation>

print-settings

Passed: a <GtkPrintSettings>.

a <GtkPrintSettings> to set

Signals

Signal: print-operation:failed

Connect a handler with (connect object print-operation:failed handler). It is called as (handler self error).

Emitted when an error occurs while printing. The given error, of the domain WEBKIT_PRINT_ERROR, contains further details of the failure. The print-operation:finished signal is emitted after this one.

self

Passed: a <WebKitPrintOperation>.

error

Passed: a <GError>.

the <GError> that was triggered

Signal: print-operation:finished

Connect a handler with (connect object print-operation:finished handler). It is called as (handler self).

Emitted when the print operation has finished doing everything required for printing.

self

Passed: a <WebKitPrintOperation>.