gtk.PrintSettingsStores print settings (new in PyGTK 2.10)Synopsisgtk.PrintSettingsgobject.GObjectgtk.PrintSettingscopyhas_keykeygetkeysetkeyvalueunsetkeyforeachfuncuser_dataNoneget_boolkeyset_boolkeyvalueget_doublekeyget_double_with_defaultkeydefset_doublekeyvalueget_lengthkeyunitset_lengthkeyvalueunitget_intkeyget_int_with_defaultkeydefset_intkeyvalueget_printerset_printerprinterget_orientationset_orientationorientationget_paper_sizeset_paper_sizepaper_sizeget_paper_widthunitset_paper_widthwidthunitget_paper_heightunitset_paper_heightheightunitget_use_colorset_use_coloruse_colorget_collateset_collatecollateget_reverseset_reversereverseget_duplexset_duplexduplexget_qualityset_qualityqualityget_n_copiesset_n_copiesnum_copiesget_number_upset_number_upnumber_upget_resolutionset_resolutionresolutionget_scaleset_scalescaleget_print_pagesset_print_pagespagesget_page_rangesnum_rangesset_page_rangespage_rangesnum_rangesget_page_setset_page_setpage_setget_default_sourceset_default_sourcedefault_sourceget_media_typeset_media_typemedia_typeget_ditherset_ditherditherget_finishingsset_finishingsfinishingsget_output_binset_output_binoutput_binto_filefile_nameget_number_up_layoutset_number_up_layoutnumber_up_layoutload_filefile_nameget_resolution_xget_resolution_yset_resolution_xyresolution_xresolution_yget_printer_lpiset_printer_lpilpiFunctionsgtk.print_settings_new_from_filefile_nameAncestry+-- gobject.GObject
+-- gtk.PrintSettings
gtk.PrintSettings Signal Prototypesgobject.GObject Signal PrototypesDescriptionA gtk.PrintSettings
object represents the settings of a print dialog in a system-independent
way. The main use for this object is that once you've printed you can
get a settings object that represents the settings the user chose, and
the next time you print you can pass that object in so that the user
doesn't have to re-set all his settings. Its also possible to enumerate the settings so that you can easily
save the settings for the next time your app runs, or even store them in
a document. The predefined keys try to use shared values as much as
possible so that moving such a document between systems still
works.Printing support was added in GTK+ 2.10.Constructorgtk.PrintSettingsgtk.PrintSettingsReturns :a new gtk.PrintSettings
objectThis constructor is available in PyGTK 2.10 and above.Creates a new gtk.PrintSettings
object.Methodsgtk.PrintSettings.copycopyReturns :a newly allocated copy of the print
settingsThis method is available in PyGTK 2.10 and above.Returns a copy of this gtk.PrintSettings
object.gtk.PrintSettings.has_keyhas_keykeykey :a keyReturns :True, if
key has a valueThis method is available in PyGTK 2.10 and above.Returns True, if a value is associated with
key.gtk.PrintSettings.getgetkeykey :a keyReturns :the string value for
keyThis method is available in PyGTK 2.10 and above.Looks up the string value associated with
key.gtk.PrintSettings.setsetkeyvaluekey :a keyvalue :a string value, or
NoneThis method is available in PyGTK 2.10 and above.Associates value with
key.gtk.PrintSettings.unsetunsetkeykey :a keyThis method is available in PyGTK 2.10 and above.Removes any value associated with key.
This has the same effect as setting the value to
None.gtk.PrintSettings.foreachforeachfuncuser_dataNonefunc :the function to calluser_data :user data for
funcThis method is available in PyGTK 2.10 and above.Calls func for each key-value pair.The signature of func is:
def func(key, value, data):
where key and
value are the key-value pair and
data is
user_data.gtk.PrintSettings.get_boolget_boolkeykey :a keyReturns :True, if
key maps to a true
value.This method is available in PyGTK 2.10 and above.Returns the boolean represented by the value that is associated
with key. gtk.PrintSettings.set_boolset_boolkeyvaluekey :a keyvalue :a booleanThis method is available in PyGTK 2.10 and above.Sets key to the boolean value specified
by value..gtk.PrintSettings.get_doubleget_doublekeykey :a keyReturns :the double value of
keyThis method is available in PyGTK 2.10 and above.Returns the double value associated with
key, or 0.gtk.PrintSettings.get_double_with_defaultget_double_with_defaultkeydefkey :a keydef :the default valueReturns :the floating point number associated with
keyThis method is available in PyGTK 2.10 and above.Returns the floating point number represented by the value that
is associated with key, or
def if the value does not represent a floating
point number.gtk.PrintSettings.set_doubleset_doublekeyvaluekey :a keyvalue :a double valueThis method is available in PyGTK 2.10 and above.Sets key to the given double
value.gtk.PrintSettings.get_lengthget_lengthkeyunitkey :a keyunit :the unit of the return valueReturns :the length value of key,
converted to unitThis method is available in PyGTK 2.10 and above.Returns the value associated with key,
interpreted as a length. The returned value is converted to the units
specified by unit.gtk.PrintSettings.set_lengthset_lengthkeyvalueunitkey :a keyvalue :a lengthunit :the unit of
lengthThis method is available in PyGTK 2.10 and above.Associates a length in units of unit with
key.gtk.PrintSettings.get_intget_intkeykey :a keyReturns :the integer value of
keyThis method is available in PyGTK 2.10 and above.Returns the integer value of key, or
0.gtk.PrintSettings.get_int_with_defaultget_int_with_defaultkeydefkey :a keydef :the default valueReturns :the integer value of
keyThis method is available in PyGTK 2.10 and above.Returns the value of key, interpreted as
an integer, or the default value specified by
def.gtk.PrintSettings.set_intset_intkeyvaluekey :a keyvalue :an integerThis method is available in PyGTK 2.10 and above.Sets key to the given integer
value.gtk.PrintSettings.get_printerget_printerReturns :the printer nameThis method is available in PyGTK 2.10 and above.Convenience method to obtain the value of the "printer"
key.gtk.PrintSettings.set_printerset_printerprinterprinter :the printer nameThis method is available in PyGTK 2.10 and above.Convenience function to set the "printer" key the value
specified by printer.gtk.PrintSettings.get_orientationget_orientationReturns :the orientationThis method is available in PyGTK 2.10 and above.Get the value of the "orientation" key, converted to one of the
.gtk.PrintSettings.set_orientationset_orientationorientationorientation :a page orientationThis method is available in PyGTK 2.10 and above.Sets the value of the "orientation" key to one of the specified by
orientation.gtk.PrintSettings.get_paper_sizeget_paper_sizeReturns :the paper sizeThis method is available in PyGTK 2.10 and above.Gets the value of the "paper-format" key, converted to a gtk.PaperSize.gtk.PrintSettings.set_paper_sizeset_paper_sizepaper_sizepaper_size :a paper sizeThis method is available in PyGTK 2.10 and above.Sets the value of the "paper-format", "paper-width" and
"paper-height" keys using the gtk.PaperSize
specified by paper_size.gtk.PrintSettings.get_paper_widthget_paper_widthunitunit :the unit for the return valueReturns :the paper width, in units of
unitThis method is available in PyGTK 2.10 and above.Retuens the value of the "printer-width" key converted to the
units specified by unit.gtk.PrintSettings.set_paper_widthset_paper_widthwidthunitwidth :the paper widthunit :the units of widthThis method is available in PyGTK 2.10 and above.Sets the value of the "printer-width" key using the units
specified by unit.gtk.PrintSettings.get_paper_heightget_paper_heightunitunit :the units for the return
valueReturns :the paper height, in units of
unitThis method is available in PyGTK 2.10 and above.Gets the value of the "paper-height" key converted to the units
specified by unit.gtk.PrintSettings.set_paper_heightset_paper_heightheightunitheight :the paper heightunit :the units of
heightThis method is available in PyGTK 2.10 and above.Sets the value of the "paper-height" key using the units
specified by unit.gtk.PrintSettings.get_use_colorget_use_colorReturns :whether to use colorThis method is available in PyGTK 2.10 and above.Returns the value of the "use-color" key. If
True color will be used when printing.gtk.PrintSettings.set_use_colorset_use_coloruse_coloruse_color :if True use
colorThis method is available in PyGTK 2.10 and above.Sets the value of the "use-color" key to the value specified by
use_color. If use_color
is True color will be used when printing.gtk.PrintSettings.get_collateget_collateReturns :True if the printed pages
are to be collatedThis method is available in PyGTK 2.10 and above.Returns the value of the "collate" key.gtk.PrintSettings.set_collateset_collatecollatecollate :if True, collate the
outputThis method is available in PyGTK 2.10 and above.Sets the value of the "collate" key. If
collate is True the output
pages will be collated.gtk.PrintSettings.get_reverseget_reverseReturns :True if the order of the
printed pages shoudl be reversed.This method is available in PyGTK 2.10 and above.Returns the value of the "reverse" key.gtk.PrintSettings.set_reverseset_reversereversereverse :if True reverse the
outputThis method is available in PyGTK 2.10 and above.Sets the value of the "reverse" key. If
reverse is True the output
pages willl be reversed.gtk.PrintSettings.get_duplexget_duplexReturns :the "duplex" key.This method is available in PyGTK 2.10 and above.Returns the value of the "duplex" key - one of the .gtk.PrintSettings.set_duplexset_duplexduplexduplex :one of the This method is available in PyGTK 2.10 and above.Sets the value of the "duplex"
key. duplexp must be one of the gtk.PrintSettings.get_qualityget_qualityReturns :the print qualityThis method is available in PyGTK 2.10 and above.Returns the value of the "quality" key.gtk.PrintSettings.set_qualityset_qualityqualityquality :one of the This method is available in PyGTK 2.10 and above.Sets the value of the "quality"
key. quality must be one of the .gtk.PrintSettings.get_n_copiesget_n_copiesReturns :the number of copies to printThis method is available in PyGTK 2.10 and above.Returns the value of the "n-copies" key.gtk.PrintSettings.set_n_copiesset_n_copiesnum_copiesnum_copies :the number of copiesThis method is available in PyGTK 2.10 and above.Sets the value of the "n-copies" key to the value specified by
num_copies.gtk.PrintSettings.get_number_upget_number_upReturns :the number of pages per sheetThis method is available in PyGTK 2.10 and above.Returns the value of the "number-up" key which specifies the
number of pages per sheet.gtk.PrintSettings.set_number_upset_number_upnumber_upnumber_up :the number of pages per sheetThis method is available in PyGTK 2.10 and above.Sets the value of the "number-up"
key. number_up specifies the number of document
pages to be printed per sheet.gtk.PrintSettings.get_resolutionget_resolutionReturns :the resolution in dpiThis method is available in PyGTK 2.10 and above.Returns the value of the "resolution" key in dpi.gtk.PrintSettings.set_resolutionset_resolutionresolutionresolution :the resolution in dpiThis method is available in PyGTK 2.10 and above.Sets the value of the "resolution" key in dpi.gtk.PrintSettings.get_scaleget_scaleReturns :the scale in percentThis method is available in PyGTK 2.10 and above.Returns the value of the "scale" key as a float number.gtk.PrintSettings.set_scaleset_scalescalescale :the scale in percentThis method is available in PyGTK 2.10 and above.Sets the value of the "scale" key using the float number
specified by scale.gtk.PrintSettings.get_print_pagesget_print_pagesReturns :which pages to printThis method is available in PyGTK 2.10 and above.Returns the value of the "print-pages" key as one if the .gtk.PrintSettings.set_print_pagesset_print_pagespagespages :one if the This method is available in PyGTK 2.10 and above.Sets the value of the "print-pages" key to one of the .gtk.PrintSettings.get_page_rangesget_page_rangesReturns :a list of [age ranges as
2-tuplesThis method is available in PyGTK 2.10 and above.Returns the value of the "page-ranges" key as a list of
2-tuples containing the start and end page numbers of each
range.gtk.PrintSettings.set_page_rangesset_page_rangespage_rangesnum_rangespage_ranges :a sequence of page range
2-tuplesThis method is available in PyGTK 2.10 and above.Sets the value of the "page-ranges" key to the value of
page_ranges which should be a sequence of
2-tuples containing the start and end page numbers of each page
range.gtk.PrintSettings.get_page_setget_page_setReturns :the set of pages to printThis method is available in PyGTK 2.10 and above.Returns the value of the "page-set" key which is one of the
.gtk.PrintSettings.set_page_setset_page_setpage_setpage_set :one of the This method is available in PyGTK 2.10 and above.Sets the value of the "page-set" key to the value specified by
page_set which should be one of the .gtk.PrintSettings.get_default_sourceget_default_sourceReturns :the default sourceThis method is available in PyGTK 2.10 and above.Returns the value of the "default-source" key.gtk.PrintSettings.set_default_sourceset_default_sourcedefault_sourcedefault_source :the default sourceThis method is available in PyGTK 2.10 and above.Sets the value of the "default-source" key to the string
specified by default_source.gtk.PrintSettings.get_media_typeget_media_typeReturns :the media typeThis method is available in PyGTK 2.10 and above.Returns the value of the "media-type" key.The set of media types is defined in PWG 5101.1-2002 PWG.gtk.PrintSettings.set_media_typeset_media_typemedia_typemedia_type :the media typeThis method is available in PyGTK 2.10 and above.Sets the value of the "media-type" key.The set of media types is defined in PWG 5101.1-2002 PWG.gtk.PrintSettings.get_ditherget_ditherReturns :the dithering that is usedThis method is available in PyGTK 2.10 and above.Returns the value of the "dither" key.gtk.PrintSettings.set_ditherset_ditherditherdither :the dithering that is usedThis method is available in PyGTK 2.10 and above.Sets the value of the "dither" key to the string specified by
dither.gtk.PrintSettings.get_finishingsget_finishingsReturns :the finishingsThis method is available in PyGTK 2.10 and above.Returns the value of the "finishings" key.gtk.PrintSettings.set_finishingsset_finishingsfinishingsfinishings :the finishingsThis method is available in PyGTK 2.10 and above.Sets the value of the "finishings" key to the string specified
by finishings.gtk.PrintSettings.get_output_binget_output_binReturns :the output binThis method is available in PyGTK 2.10 and above.Returns the value of the "output-bin" key.gtk.PrintSettings.set_output_binset_output_binoutput_binoutput_bin :the output binThis method is available in PyGTK 2.10 and above.Sets the value of the "output-bin" key to the value specified by
output_bin.gtk.PrintSettings.to_fileto_filefile_namefilename :the file to save to.Returns :True on sucess.This method is available in PyGTK 2.12 and above.This function saves the print settings from settings to file_name.gtk.PrintSettings.get_number_up_layoutget_number_up_layoutReturns :layout of page in number-up mode.This method is available in PyGTK 2.16 and above.gtk.PrintSettings.set_number_up_layoutset_number_up_layoutnumber_up_layoutnumber_up_layout :a
GtkNumberUpLayout
constant value.This method is available in PyGTK 2.16 and above.Sets the value of GtkNumberUpLayout.gtk.PrintSettings.load_fileload_filefile_namefile_name :the filename to read the settings from.Returns :True on success.This method is available in PyGTK 2.16 and above.
Reads the print settings from file_name. See
gtk.PrintSettings.to_file.
gtk.PrintSettings.get_resolution_xget_resolution_xReturns :the horizontal resolution in dpi.This method is available in PyGTK 2.16 and above.The get_resolution_x() method gets the value of
gtk.PRINT_SETTINGS_RESOLUTION_X.gtk.PrintSettings.get_resolution_yget_resolution_yReturns :the vertical resolution in dpi.This method is available in PyGTK 2.16 and above.The get_resolution_y() method gets the value of
gtk.PRINT_SETTINGS_RESOLUTION_Y.gtk.PrintSettings.set_resolution_xyset_resolution_xyresolution_xresolution_yresolution_x :the horizontal resolution in dpi.resolution_y :the vertical resolution in dpi.This method is available in PyGTK 2.16 and above.The set_resolution_xy() method sets the values of
gtk.PRINT_SETTINGS_RESOLUTION, gtk.PRINT_SETTINGS_RESOLUTION_X
and gtk.PRINT_SETTINGS_RESOLUTION_Y.gtk.PrintSettings.get_printer_lpiget_printer_lpiReturns :the resolution in lpi (lines per inch).This method is available in PyGTK 2.16 and above.The get_printer_lpi() method gets the value of
gtk.PRINT_SETTINGS_PRINTER_LPI.gtk.PrintSettings.set_printer_lpiset_printer_lpilpilpi :the resolution in lpi (lines per inch).This method is available in PyGTK 2.16 and above.The set_printer_lpi() method sets the value of
gtk.PRINT_SETTINGS_PRINTER_LPI.Functionsgtk.print_settings_new_from_filegtk.print_settings_new_from_filefile_namefile_name :the filename to read the settings from.Returns :the restored
gtk.PrintSettingsThis function is available in PyGTK 2.12 and above.Reads the print settings from filename. Returns a new
gtk.PrintSettings
object with the restored settings, or None if an error occurred. See
gtk.PrintSettings.to_file().