| gtk-High-level-Printing-API {RGtk2} | R Documentation |
High-level Printing API
gtkPrintOperationNew()
gtkPrintOperationSetAllowAsync(object, allow.async)
gtkPrintOperationGetError(object, .errwarn = TRUE)
gtkPrintOperationSetDefaultPageSetup(object, default.page.setup = NULL)
gtkPrintOperationGetDefaultPageSetup(object)
gtkPrintOperationSetPrintSettings(object, print.settings = NULL)
gtkPrintOperationGetPrintSettings(object)
gtkPrintOperationSetJobName(object, job.name)
gtkPrintOperationSetNPages(object, n.pages)
gtkPrintOperationGetNPagesToPrint(object)
gtkPrintOperationSetCurrentPage(object, current.page)
gtkPrintOperationSetUseFullPage(object, full.page)
gtkPrintOperationSetUnit(object, unit)
gtkPrintOperationSetExportFilename(object, filename)
gtkPrintOperationSetShowProgress(object, show.progress)
gtkPrintOperationSetTrackPrintStatus(object, track.status)
gtkPrintOperationSetCustomTabLabel(object, label)
gtkPrintOperationRun(object, action, parent = NULL, .errwarn = TRUE)
gtkPrintOperationCancel(object)
gtkPrintOperationDrawPageFinish(object)
gtkPrintOperationSetDeferDrawing(object)
gtkPrintOperationGetStatus(object)
gtkPrintOperationGetStatusString(object)
gtkPrintOperationIsFinished(object)
gtkPrintOperationSetSupportSelection(object, support.selection)
gtkPrintOperationGetSupportSelection(object)
gtkPrintOperationSetHasSelection(object, has.selection)
gtkPrintOperationGetHasSelection(object)
gtkPrintOperationSetEmbedPageSetup(object, embed)
gtkPrintOperationGetEmbedPageSetup(object)
gtkPrintRunPageSetupDialog(parent, page.setup = NULL, settings)
gtkPrintRunPageSetupDialogAsync(parent, page.setup, settings, done.cb, data)
gtkPrintOperationPreviewEndPreview(object)
gtkPrintOperationPreviewIsSelected(object, page.nr)
gtkPrintOperationPreviewRenderPage(object, page.nr)
gtkPrintOperation()
GObject +----GtkPrintOperation GInterface +----GtkPrintOperationPreview
GtkPrintOperationPreview is implemented by
GtkPrintOperation.
GtkPrintOperation implements
GtkPrintOperationPreview.
GtkPrintOperation is the high-level, portable printing API. It looks
a bit different than other GTK+ dialogs such as the GtkFileChooser,
since some platforms don't expose enough infrastructure to implement
a good print dialog. On such platforms, GtkPrintOperation uses the
native print dialog. On platforms which do not provide a native
print dialog, GTK+ uses its own, see
GtkPrintUnixDialog. The typical way to use the high-level printing API is to create a
GtkPrintOperation object with gtkPrintOperationNew when the user
selects to print. Then you set some properties on it, e.g. the page size,
any GtkPrintSettings from previous print operations, the number of pages,
the current page, etc.
Then you start the print operation by calling gtkPrintOperationRun.
It will then show a dialog, let the user select a printer and options.
When the user finished the dialog various signals will be emitted on the
GtkPrintOperation, the main one being ::draw-page, which you are supposed
to catch and render the page on the provided GtkPrintContext using Cairo.
The high-level printing API
settings <- NULL
print_something <-
{
op <- gtkPrintOperation()
if (!is.null(settings))
op$setPrintSettings(settings)
gSignalConnect(op, "begin_print", begin_print)
gSignalConnect(op, "draw_page", draw_page)
res <- op$run("print-dialog", main_window)[[1]]
if (res == "apply")
settings <- op$getPrintSettings()
}
By default GtkPrintOperation uses an external application to do
print preview. To implement a custom print preview, an application
must connect to the preview signal. The functions
gtkPrintOperationPrintPreviewRenderPage(),
gtkPrintOperationPreviewEndPreview and
gtkPrintOperationPreviewIsSelected are useful
when implementing a print preview.
Printing support was added in GTK+ 2.10.
gtkPrintOperation is the equivalent of gtkPrintOperationNew.
GtkPageSetupDoneFunc(page.setup, data)The type of function that is passed to gtkPrintRunPageSetupDialogAsync.
This function will be called when the page setup dialog is dismissed, and
also serves as destroy notify for data.
page.setupthe GtkPageSetup that has been
datauser data that has been passed to
gtkPrintRunPageSetupDialogAsync.
Derived by RGtkGen from GTK+ documentation
http://library.gnome.org/devel//gtk/gtk-High-level-Printing-API.html