---
name: "Gtk2::PrintOperation"
section: "3pm"
platform: "linux"
package: "libgtk2-perl-doc"
version: "2:1.24992-1"
release: "Debian 10 (Buster)"
platforms: ["linux"]
url: "https://new.carta.tech/Gtk2::PrintOperation"
---

# Gtk2::PrintOperation(3pm)

wrapper for GtkPrintOperation

## NAME

Gtk2::PrintOperation - wrapper for GtkPrintOperation

## HIERARCHY

```
  Glib::Object
  +----Gtk2::PrintOperation
```

## INTERFACES

```
  Gtk2::PrintOperationPreview
```

## METHODS

### printoperation = Gtk2::PrintOperation-\>new

### $op-\>set\_allow\_async ($allow\_async)

- •

  `$allow_async` (boolean)

### $op-\>cancel

### $op-\>set\_current\_page ($current\_page)

- •

  `$current_page` (integer)

### $op-\>set\_custom\_tab\_label ($label)

- •

  `$label` (string)

### pagesetup or undef = $op-\>get\_default\_page\_setup

### $op-\>set\_default\_page\_setup ($default\_page\_setup)

- •

  `$default_page_setup` (Gtk2::PageSetup or undef)

### $op-\>set\_defer\_drawing ()

The method *set\_defer\_drawing()* can only be called from the callback `'draw-page'`.

Since: gtk+ 2.16

### $op-\>draw\_page\_finish ()

The method *draw\_page\_finish()* can only be called if the method *set\_defer\_drawing()* has been called previously otherwise a segmentation fault will occur. This means that the application will crash and even an eval will not be able to recover from that error.

Since: gtk+ 2.16

### boolean = $op-\>get\_embed\_page\_setup

Since: gtk+ 2.18

### $op-\>set\_embed\_page\_setup ($embed)

- •

  `$embed` (boolean)

Since: gtk+ 2.18

### scalar = $op-\>get\_error

### $op-\>set\_export\_filename ($filename)

- •

  `$filename` (string)

### boolean = $op-\>get\_has\_selection

Since: gtk+ 2.18

### $op-\>set\_has\_selection ($has\_selection)

- •

  `$has_selection` (boolean)

Since: gtk+ 2.18

### boolean = $op-\>is\_finished

### $op-\>set\_job\_name ($job\_name)

- •

  `$job_name` (string)

### $op-\>set\_n\_pages ($n\_pages)

- •

  `$n_pages` (integer)

### integer = $op-\>get\_n\_pages\_to\_print

Since: gtk+ 2.18

### printsettings or undef = $op-\>get\_print\_settings

### $op-\>set\_print\_settings ($print\_settings)

- •

  `$print_settings` (Gtk2::PrintSettings or undef)

### printoperationresult = $op-\>run ($action, $parent)

- •

  `$action` (Gtk2::PrintOperationAction)

- •

  `$parent` (Gtk2::Window or undef)

May croak with a Glib::Error in $@ on failure.

### $op-\>set\_show\_progress ($show\_progress)

- •

  `$show_progress` (boolean)

### printstatus = $op-\>get\_status

### string = $op-\>get\_status\_string

### boolean = $op-\>get\_support\_selection

Since: gtk+ 2.18

### $op-\>set\_support\_selection ($support\_selection)

- •

  `$support_selection` (boolean)

Since: gtk+ 2.18

### $op-\>set\_track\_print\_status ($track\_status)

- •

  `$track_status` (boolean)

### $op-\>set\_unit ($unit)

- •

  `$unit` (Gtk2::Unit)

### $op-\>set\_use\_full\_page ($full\_page)

- •

  `$full_page` (boolean)

## PROPERTIES

- 'allow-async' (boolean : default false : readable / writable / private)

  TRUE if print process may run asynchronous.

- 'current-page' (integer : default -1 : readable / writable / private)

  The current page in the document

- 'custom-tab-label' (string : default undef : readable / writable / private)

  Label for the tab containing custom widgets.

- 'default-page-setup' (Gtk2::PageSetup : default undef : readable / writable / private)

  The GtkPageSetup used by default

- 'embed-page-setup' (boolean : default false : readable / writable / private)

  TRUE if page setup combos are embedded in GtkPrintDialog

- 'export-filename' (string : default undef : readable / writable / private)

  Export filename

- 'has-selection' (boolean : default false : readable / writable / private)

  TRUE if a selection exists.

- 'job-name' (string : default "" : readable / writable / private)

  A string used for identifying the print job.

- 'n-pages' (integer : default -1 : readable / writable / private)

  The number of pages in the document.

- 'n-pages-to-print' (integer : default -1 : readable / private)

  The number of pages that will be printed.

- 'print-settings' (Gtk2::PrintSettings : default undef : readable / writable / private)

  The GtkPrintSettings used for initializing the dialog

- 'show-progress' (boolean : default false : readable / writable / private)

  TRUE if a progress dialog is shown while printing.

- 'status' (Gtk2::PrintStatus : default "initial" : readable / private)

  The status of the print operation

- 'status-string' (string : default "" : readable / private)

  A human-readable description of the status

- 'support-selection' (boolean : default false : readable / writable / private)

  TRUE if the print operation will support print of selection.

- 'track-print-status' (boolean : default false : readable / writable / private)

  TRUE if the print operation will continue to report on the print job status after the print data has been sent to the printer or print server.

- 'unit' (Gtk2::Unit : default "pixel" : readable / writable / private)

  The unit in which distances can be measured in the context

- 'use-full-page' (boolean : default false : readable / writable / private)

  TRUE if the origin of the context should be at the corner of the page and not the corner of the imageable area

## SIGNALS

- **begin-print** (Gtk2::PrintOperation, Gtk2::PrintContext)

  - Glib::Object = **create-custom-widget** (Gtk2::PrintOperation)

  - **custom-widget-apply** (Gtk2::PrintOperation, Gtk2::Widget)

  - **done** (Gtk2::PrintOperation, Gtk2::PrintOperationResult)

  - **draw-page** (Gtk2::PrintOperation, Gtk2::PrintContext, integer)

  - **end-print** (Gtk2::PrintOperation, Gtk2::PrintContext)

  - boolean = **paginate** (Gtk2::PrintOperation, Gtk2::PrintContext)

  - boolean = **preview** (Gtk2::PrintOperation, Gtk2::PrintOperationPreview, Gtk2::PrintContext, Gtk2::Window)

  - **request-page-setup** (Gtk2::PrintOperation, Gtk2::PrintContext, integer, Gtk2::PageSetup)

  - **status-changed** (Gtk2::PrintOperation)

  - **update-custom-widget** (Gtk2::PrintOperation, Gtk2::Widget, Gtk2::PageSetup, Gtk2::PrintSettings)

  ## ENUMS AND FLAGS

### enum Gtk2::PrintOperationAction

- •

  'print-dialog' / 'GTK\_PRINT\_OPERATION\_ACTION\_PRINT\_DIALOG'

- •

  'print' / 'GTK\_PRINT\_OPERATION\_ACTION\_PRINT'

- •

  'preview' / 'GTK\_PRINT\_OPERATION\_ACTION\_PREVIEW'

- •

  'export' / 'GTK\_PRINT\_OPERATION\_ACTION\_EXPORT'

### enum Gtk2::PrintOperationResult

- •

  'error' / 'GTK\_PRINT\_OPERATION\_RESULT\_ERROR'

- •

  'apply' / 'GTK\_PRINT\_OPERATION\_RESULT\_APPLY'

- •

  'cancel' / 'GTK\_PRINT\_OPERATION\_RESULT\_CANCEL'

- •

  'in-progress' / 'GTK\_PRINT\_OPERATION\_RESULT\_IN\_PROGRESS'

### enum Gtk2::PrintStatus

- •

  'initial' / 'GTK\_PRINT\_STATUS\_INITIAL'

- •

  'preparing' / 'GTK\_PRINT\_STATUS\_PREPARING'

- •

  'generating-data' / 'GTK\_PRINT\_STATUS\_GENERATING\_DATA'

- •

  'sending-data' / 'GTK\_PRINT\_STATUS\_SENDING\_DATA'

- •

  'pending' / 'GTK\_PRINT\_STATUS\_PENDING'

- •

  'pending-issue' / 'GTK\_PRINT\_STATUS\_PENDING\_ISSUE'

- •

  'printing' / 'GTK\_PRINT\_STATUS\_PRINTING'

- •

  'finished' / 'GTK\_PRINT\_STATUS\_FINISHED'

- •

  'finished-aborted' / 'GTK\_PRINT\_STATUS\_FINISHED\_ABORTED'

### enum Gtk2::Unit

- •

  'pixel' / 'GTK\_UNIT\_PIXEL'

- •

  'points' / 'GTK\_UNIT\_POINTS'

- •

  'inch' / 'GTK\_UNIT\_INCH'

- •

  'mm' / 'GTK\_UNIT\_MM'

## SEE ALSO

Gtk2, Glib::Object

## COPYRIGHT

Copyright (C) 2003-2011 by the gtk2-perl team.

This software is licensed under the LGPL.  See Gtk2 for a full notice.
