Gtk.PrintSettings¶
| Subclasses: | None | 
|---|
Methods¶
| Inherited: | GObject.Object (37) | 
|---|---|
| Structs: | GObject.ObjectClass (5) | 
Virtual Methods¶
| Inherited: | GObject.Object (7) | 
|---|
Properties¶
None
Signals¶
| Inherited: | GObject.Object (1) | 
|---|
Fields¶
| Inherited: | GObject.Object (1) | 
|---|
Class Details¶
- 
class Gtk.PrintSettings(**kwargs)¶
- Bases: - GObject.Object- Abstract: - No - A - Gtk.PrintSettingsobject 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. - 
classmethod new()[source]¶
- Returns: - a new - Gtk.PrintSettingsobject- Return type: - Gtk.PrintSettings- Creates a new - Gtk.PrintSettingsobject.- New in version 2.10. 
 - 
classmethod new_from_file(file_name)[source]¶
- Parameters: - file_name ( - str) – the filename to read the settings from- Raises: - GLib.Error- Returns: - the restored - Gtk.PrintSettings- Return type: - Gtk.PrintSettings- Reads the print settings from file_name. Returns a new - Gtk.PrintSettingsobject with the restored settings, or- Noneif an error occurred. If the file could not be loaded then error is set to either a- GLib.FileErroror- GLib.KeyFileError. See- Gtk.PrintSettings.to_file().- New in version 2.12. 
 - 
classmethod new_from_gvariant(variant)[source]¶
- Parameters: - variant ( - GLib.Variant) – an a{sv}- GLib.Variant- Returns: - a new - Gtk.PrintSettingsobject- Return type: - Gtk.PrintSettings- Deserialize print settings from an a{sv} variant in the format produced by - Gtk.PrintSettings.to_gvariant().- New in version 3.22. 
 - 
classmethod new_from_key_file(key_file, group_name)[source]¶
- Parameters: - key_file (GLib.KeyFile) – theGLib.KeyFileto retrieve the settings from
- group_name (strorNone) – the name of the group to use, orNoneto use the default “Print Settings”
 - Raises: - Returns: - the restored - Gtk.PrintSettings- Return type: - Reads the print settings from the group group_name in key_file. Returns a new - Gtk.PrintSettingsobject with the restored settings, or- Noneif an error occurred. If the file could not be loaded then error is set to either a- GLib.FileErroror- GLib.KeyFileError.- New in version 2.12. 
- key_file (
 - 
copy()[source]¶
- Returns: - a newly allocated copy of self - Return type: - Gtk.PrintSettings- Copies a - Gtk.PrintSettingsobject.- New in version 2.10. 
 - 
foreach(func, *user_data)[source]¶
- Parameters: - func (Gtk.PrintSettingsFunc) – the function to call
- user_data (objectorNone) – user data for func
 - Calls func for each key-value pair of self. - New in version 2.10. 
- func (
 - 
get(key)[source]¶
- Parameters: - key ( - str) – a key- Returns: - the string value for key - Return type: - str- Looks up the string value associated with key. - New in version 2.10. 
 - 
get_bool(key)[source]¶
- Parameters: - key ( - str) – a key- Returns: - True, if key maps to a true value.- Return type: - bool- Returns the boolean represented by the value that is associated with key. - The string “true” represents - True, any other string- False.- New in version 2.10. 
 - 
get_collate()[source]¶
- Returns: - whether to collate the printed pages - Return type: - bool- Gets the value of - Gtk.PRINT_SETTINGS_COLLATE.- New in version 2.10. 
 - 
get_default_source()[source]¶
- Returns: - the default source - Return type: - str- Gets the value of - Gtk.PRINT_SETTINGS_DEFAULT_SOURCE.- New in version 2.10. 
 - 
get_dither()[source]¶
- Returns: - the dithering that is used - Return type: - str- Gets the value of - Gtk.PRINT_SETTINGS_DITHER.- New in version 2.10. 
 - 
get_double(key)[source]¶
- Parameters: - key ( - str) – a key- Returns: - the double value of key - Return type: - float- Returns the double value associated with key, or 0. - New in version 2.10. 
 - 
get_double_with_default(key, def_)[source]¶
- Parameters: - Returns: - the floating point number associated with key - Return type: - Returns the floating point number represented by the value that is associated with key, or default_val if the value does not represent a floating point number. - Floating point numbers are parsed with - GLib.ascii_strtod().- New in version 2.10. 
 - 
get_duplex()[source]¶
- Returns: - whether to print the output in duplex. - Return type: - Gtk.PrintDuplex- Gets the value of - Gtk.PRINT_SETTINGS_DUPLEX.- New in version 2.10. 
 - 
get_finishings()[source]¶
- Returns: - the finishings - Return type: - str- Gets the value of - Gtk.PRINT_SETTINGS_FINISHINGS.- New in version 2.10. 
 - 
get_int(key)[source]¶
- Parameters: - key ( - str) – a key- Returns: - the integer value of key - Return type: - int- Returns the integer value of key, or 0. - New in version 2.10. 
 - 
get_int_with_default(key, def_)[source]¶
- Parameters: - Returns: - the integer value of key - Return type: - Returns the value of key, interpreted as an integer, or the default value. - New in version 2.10. 
 - 
get_length(key, unit)[source]¶
- Parameters: - Returns: - the length value of key, converted to unit - Return type: - Returns the value associated with key, interpreted as a length. The returned value is converted to units. - New in version 2.10. 
 - 
get_media_type()[source]¶
- Returns: - the media type - Return type: - str- Gets the value of - Gtk.PRINT_SETTINGS_MEDIA_TYPE.- The set of media types is defined in PWG 5101.1-2002 PWG. - New in version 2.10. 
 - 
get_n_copies()[source]¶
- Returns: - the number of copies to print - Return type: - int- Gets the value of - Gtk.PRINT_SETTINGS_N_COPIES.- New in version 2.10. 
 - 
get_number_up()[source]¶
- Returns: - the number of pages per sheet - Return type: - int- Gets the value of - Gtk.PRINT_SETTINGS_NUMBER_UP.- New in version 2.10. 
 - 
get_number_up_layout()[source]¶
- Returns: - layout of page in number-up mode - Return type: - Gtk.NumberUpLayout- Gets the value of - Gtk.PRINT_SETTINGS_NUMBER_UP_LAYOUT.- New in version 2.14. 
 - 
get_orientation()[source]¶
- Returns: - the orientation - Return type: - Gtk.PageOrientation- Get the value of - Gtk.PRINT_SETTINGS_ORIENTATION, converted to a- Gtk.PageOrientation.- New in version 2.10. 
 - 
get_output_bin()[source]¶
- Returns: - the output bin - Return type: - str- Gets the value of - Gtk.PRINT_SETTINGS_OUTPUT_BIN.- New in version 2.10. 
 - 
get_page_ranges()[source]¶
- Returns: - an array of - Gtk.PageRanges. Use- GLib.free() to free the array when it is no longer needed.- Return type: - [ - Gtk.PageRange]- Gets the value of - Gtk.PRINT_SETTINGS_PAGE_RANGES.- New in version 2.10. 
 - 
get_page_set()[source]¶
- Returns: - the set of pages to print - Return type: - Gtk.PageSet- Gets the value of - Gtk.PRINT_SETTINGS_PAGE_SET.- New in version 2.10. 
 - 
get_paper_height(unit)[source]¶
- Parameters: - unit ( - Gtk.Unit) – the unit for the return value- Returns: - the paper height, in units of unit - Return type: - float- Gets the value of - Gtk.PRINT_SETTINGS_PAPER_HEIGHT, converted to unit.- New in version 2.10. 
 - 
get_paper_size()[source]¶
- Returns: - the paper size - Return type: - Gtk.PaperSize- Gets the value of - Gtk.PRINT_SETTINGS_PAPER_FORMAT, converted to a- Gtk.PaperSize.- New in version 2.10. 
 - 
get_paper_width(unit)[source]¶
- Parameters: - unit ( - Gtk.Unit) – the unit for the return value- Returns: - the paper width, in units of unit - Return type: - float- Gets the value of - Gtk.PRINT_SETTINGS_PAPER_WIDTH, converted to unit.- New in version 2.10. 
 - 
get_print_pages()[source]¶
- Returns: - which pages to print - Return type: - Gtk.PrintPages- Gets the value of - Gtk.PRINT_SETTINGS_PRINT_PAGES.- New in version 2.10. 
 - 
get_printer()[source]¶
- Returns: - the printer name - Return type: - str- Convenience function to obtain the value of - Gtk.PRINT_SETTINGS_PRINTER.- New in version 2.10. 
 - 
get_printer_lpi()[source]¶
- Returns: - the resolution in lpi (lines per inch) - Return type: - float- Gets the value of - Gtk.PRINT_SETTINGS_PRINTER_LPI.- New in version 2.16. 
 - 
get_quality()[source]¶
- Returns: - the print quality - Return type: - Gtk.PrintQuality- Gets the value of - Gtk.PRINT_SETTINGS_QUALITY.- New in version 2.10. 
 - 
get_resolution()[source]¶
- Returns: - the resolution in dpi - Return type: - int- Gets the value of - Gtk.PRINT_SETTINGS_RESOLUTION.- New in version 2.10. 
 - 
get_resolution_x()[source]¶
- Returns: - the horizontal resolution in dpi - Return type: - int- Gets the value of - Gtk.PRINT_SETTINGS_RESOLUTION_X.- New in version 2.16. 
 - 
get_resolution_y()[source]¶
- Returns: - the vertical resolution in dpi - Return type: - int- Gets the value of - Gtk.PRINT_SETTINGS_RESOLUTION_Y.- New in version 2.16. 
 - 
get_reverse()[source]¶
- Returns: - whether to reverse the order of the printed pages - Return type: - bool- Gets the value of - Gtk.PRINT_SETTINGS_REVERSE.- New in version 2.10. 
 - 
get_scale()[source]¶
- Returns: - the scale in percent - Return type: - float- Gets the value of - Gtk.PRINT_SETTINGS_SCALE.- New in version 2.10. 
 - 
get_use_color()[source]¶
- Returns: - whether to use color - Return type: - bool- Gets the value of - Gtk.PRINT_SETTINGS_USE_COLOR.- New in version 2.10. 
 - 
has_key(key)[source]¶
- Parameters: - key ( - str) – a key- Returns: - True, if key has a value- Return type: - bool- Returns - True, if a value is associated with key.- New in version 2.10. 
 - 
load_file(file_name)[source]¶
- Parameters: - file_name ( - str) – the filename to read the settings from- Raises: - GLib.Error- Returns: - Trueon success- Return type: - bool- Reads the print settings from file_name. If the file could not be loaded then error is set to either a - GLib.FileErroror- GLib.KeyFileError. See- Gtk.PrintSettings.to_file().- New in version 2.14. 
 - 
load_key_file(key_file, group_name)[source]¶
- Parameters: - key_file (GLib.KeyFile) – theGLib.KeyFileto retrieve the settings from
- group_name (strorNone) – the name of the group to use, orNoneto use the default “Print Settings”
 - Raises: - Returns: - Trueon success- Return type: - Reads the print settings from the group group_name in key_file. If the file could not be loaded then error is set to either a - GLib.FileErroror- GLib.KeyFileError.- New in version 2.14. 
- key_file (
 - 
set_collate(collate)[source]¶
- Parameters: - collate ( - bool) – whether to collate the output- Sets the value of - Gtk.PRINT_SETTINGS_COLLATE.- New in version 2.10. 
 - 
set_default_source(default_source)[source]¶
- Parameters: - default_source ( - str) – the default source- Sets the value of - Gtk.PRINT_SETTINGS_DEFAULT_SOURCE.- New in version 2.10. 
 - 
set_dither(dither)[source]¶
- Parameters: - dither ( - str) – the dithering that is used- Sets the value of - Gtk.PRINT_SETTINGS_DITHER.- New in version 2.10. 
 - 
set_duplex(duplex)[source]¶
- Parameters: - duplex ( - Gtk.PrintDuplex) – a- Gtk.PrintDuplexvalue- Sets the value of - Gtk.PRINT_SETTINGS_DUPLEX.- New in version 2.10. 
 - 
set_finishings(finishings)[source]¶
- Parameters: - finishings ( - str) – the finishings- Sets the value of - Gtk.PRINT_SETTINGS_FINISHINGS.- New in version 2.10. 
 - 
set_length(key, value, unit)[source]¶
- Parameters: - Associates a length in units of unit with key. - New in version 2.10. 
 - 
set_media_type(media_type)[source]¶
- Parameters: - media_type ( - str) – the media type- Sets the value of - Gtk.PRINT_SETTINGS_MEDIA_TYPE.- The set of media types is defined in PWG 5101.1-2002 PWG. - New in version 2.10. 
 - 
set_n_copies(num_copies)[source]¶
- Parameters: - num_copies ( - int) – the number of copies- Sets the value of - Gtk.PRINT_SETTINGS_N_COPIES.- New in version 2.10. 
 - 
set_number_up(number_up)[source]¶
- Parameters: - number_up ( - int) – the number of pages per sheet- Sets the value of - Gtk.PRINT_SETTINGS_NUMBER_UP.- New in version 2.10. 
 - 
set_number_up_layout(number_up_layout)[source]¶
- Parameters: - number_up_layout ( - Gtk.NumberUpLayout) – a- Gtk.NumberUpLayoutvalue- Sets the value of - Gtk.PRINT_SETTINGS_NUMBER_UP_LAYOUT.- New in version 2.14. 
 - 
set_orientation(orientation)[source]¶
- Parameters: - orientation ( - Gtk.PageOrientation) – a page orientation- Sets the value of - Gtk.PRINT_SETTINGS_ORIENTATION.- New in version 2.10. 
 - 
set_output_bin(output_bin)[source]¶
- Parameters: - output_bin ( - str) – the output bin- Sets the value of - Gtk.PRINT_SETTINGS_OUTPUT_BIN.- New in version 2.10. 
 - 
set_page_ranges(page_ranges)[source]¶
- Parameters: - page_ranges ([ - Gtk.PageRange]) – an array of- Gtk.PageRanges- Sets the value of - Gtk.PRINT_SETTINGS_PAGE_RANGES.- New in version 2.10. 
 - 
set_page_set(page_set)[source]¶
- Parameters: - page_set ( - Gtk.PageSet) – a- Gtk.PageSetvalue- Sets the value of - Gtk.PRINT_SETTINGS_PAGE_SET.- New in version 2.10. 
 - 
set_paper_height(height, unit)[source]¶
- Parameters: - Sets the value of - Gtk.PRINT_SETTINGS_PAPER_HEIGHT.- New in version 2.10. 
 - 
set_paper_size(paper_size)[source]¶
- Parameters: - paper_size ( - Gtk.PaperSize) – a paper size- Sets the value of - Gtk.PRINT_SETTINGS_PAPER_FORMAT,- Gtk.PRINT_SETTINGS_PAPER_WIDTHand- Gtk.PRINT_SETTINGS_PAPER_HEIGHT.- New in version 2.10. 
 - 
set_paper_width(width, unit)[source]¶
- Parameters: - Sets the value of - Gtk.PRINT_SETTINGS_PAPER_WIDTH.- New in version 2.10. 
 - 
set_print_pages(pages)[source]¶
- Parameters: - pages ( - Gtk.PrintPages) – a- Gtk.PrintPagesvalue- Sets the value of - Gtk.PRINT_SETTINGS_PRINT_PAGES.- New in version 2.10. 
 - 
set_printer(printer)[source]¶
- Parameters: - printer ( - str) – the printer name- Convenience function to set - Gtk.PRINT_SETTINGS_PRINTERto printer.- New in version 2.10. 
 - 
set_printer_lpi(lpi)[source]¶
- Parameters: - lpi ( - float) – the resolution in lpi (lines per inch)- Sets the value of - Gtk.PRINT_SETTINGS_PRINTER_LPI.- New in version 2.16. 
 - 
set_quality(quality)[source]¶
- Parameters: - quality ( - Gtk.PrintQuality) – a- Gtk.PrintQualityvalue- Sets the value of - Gtk.PRINT_SETTINGS_QUALITY.- New in version 2.10. 
 - 
set_resolution(resolution)[source]¶
- Parameters: - resolution ( - int) – the resolution in dpi- Sets the values of - Gtk.PRINT_SETTINGS_RESOLUTION,- Gtk.PRINT_SETTINGS_RESOLUTION_Xand- Gtk.PRINT_SETTINGS_RESOLUTION_Y.- New in version 2.10. 
 - 
set_resolution_xy(resolution_x, resolution_y)[source]¶
- Parameters: - Sets the values of - Gtk.PRINT_SETTINGS_RESOLUTION,- Gtk.PRINT_SETTINGS_RESOLUTION_Xand- Gtk.PRINT_SETTINGS_RESOLUTION_Y.- New in version 2.16. 
 - 
set_reverse(reverse)[source]¶
- Parameters: - reverse ( - bool) – whether to reverse the output- Sets the value of - Gtk.PRINT_SETTINGS_REVERSE.- New in version 2.10. 
 - 
set_scale(scale)[source]¶
- Parameters: - scale ( - float) – the scale in percent- Sets the value of - Gtk.PRINT_SETTINGS_SCALE.- New in version 2.10. 
 - 
set_use_color(use_color)[source]¶
- Parameters: - use_color ( - bool) – whether to use color- Sets the value of - Gtk.PRINT_SETTINGS_USE_COLOR.- New in version 2.10. 
 - 
to_file(file_name)[source]¶
- Parameters: - file_name ( - str) – the file to save to- Raises: - GLib.Error- Returns: - Trueon success- Return type: - bool- This function saves the print settings from self to file_name. If the file could not be loaded then error is set to either a - GLib.FileErroror- GLib.KeyFileError.- New in version 2.12. 
 - 
to_gvariant()[source]¶
- Returns: - a new, floating, - GLib.Variant- Return type: - GLib.Variant- Serialize print settings to an a{sv} variant. - New in version 3.22. 
 - 
to_key_file(key_file, group_name)[source]¶
- Parameters: - key_file (GLib.KeyFile) – theGLib.KeyFileto save the print settings to
- group_name (strorNone) – the group to add the settings to in key_file, orNoneto use the default “Print Settings”
 - This function adds the print settings from self to key_file. - New in version 2.12. 
- key_file (
 
- 
classmethod