gtk.PrintSettings Stores print settings (new in PyGTK 2.10) Synopsis gtk.PrintSettings gobject.GObject gtk.PrintSettings copy has_key key get key set key value unset key foreach func user_dataNone get_bool key set_bool key value get_double key get_double_with_default key def set_double key value get_length key unit set_length key value unit get_int key get_int_with_default key def set_int key value get_printer set_printer printer get_orientation set_orientation orientation get_paper_size set_paper_size paper_size get_paper_width unit set_paper_width width unit get_paper_height unit set_paper_height height unit get_use_color set_use_color use_color get_collate set_collate collate get_reverse set_reverse reverse get_duplex set_duplex duplex get_quality set_quality quality get_n_copies set_n_copies num_copies get_number_up set_number_up number_up get_resolution set_resolution resolution get_scale set_scale scale get_print_pages set_print_pages pages get_page_ranges num_ranges set_page_ranges page_ranges num_ranges get_page_set set_page_set page_set get_default_source set_default_source default_source get_media_type set_media_type media_type get_dither set_dither dither get_finishings set_finishings finishings get_output_bin set_output_bin output_bin to_file file_name get_number_up_layout set_number_up_layout number_up_layout load_file file_name get_resolution_x get_resolution_y set_resolution_xy resolution_x resolution_y get_printer_lpi set_printer_lpi lpi Functions gtk.print_settings_new_from_file file_name Ancestry +-- gobject.GObject +-- gtk.PrintSettings gtk.PrintSettings Signal Prototypes gobject.GObject Signal Prototypes Description A 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. Constructor gtk.PrintSettings gtk.PrintSettings Returns : a new gtk.PrintSettings object This constructor is available in PyGTK 2.10 and above. Creates a new gtk.PrintSettings object. Methods gtk.PrintSettings.copy copy Returns : a newly allocated copy of the print settings This method is available in PyGTK 2.10 and above. Returns a copy of this gtk.PrintSettings object. gtk.PrintSettings.has_key has_key key key : a key Returns : True, if key has a value This method is available in PyGTK 2.10 and above. Returns True, if a value is associated with key. gtk.PrintSettings.get get key key : a key Returns : the string value for key This method is available in PyGTK 2.10 and above. Looks up the string value associated with key. gtk.PrintSettings.set set key value key : a key value : a string value, or None This method is available in PyGTK 2.10 and above. Associates value with key. gtk.PrintSettings.unset unset key key : a key This 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.foreach foreach func user_dataNone func : the function to call user_data : user data for func This 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_bool get_bool key key : a key Returns : 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_bool set_bool key value key : a key value : a boolean This method is available in PyGTK 2.10 and above. Sets key to the boolean value specified by value.. gtk.PrintSettings.get_double get_double key key : a key Returns : the double value of key This method is available in PyGTK 2.10 and above. Returns the double value associated with key, or 0. gtk.PrintSettings.get_double_with_default get_double_with_default key def key : a key def : the default value Returns : the floating point number associated with key This 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_double set_double key value key : a key value : a double value This method is available in PyGTK 2.10 and above. Sets key to the given double value. gtk.PrintSettings.get_length get_length key unit key : a key unit : the unit of the return value Returns : the length value of key, converted to unit This 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_length set_length key value unit key : a key value : a length unit : the unit of length This method is available in PyGTK 2.10 and above. Associates a length in units of unit with key. gtk.PrintSettings.get_int get_int key key : a key Returns : the integer value of key This method is available in PyGTK 2.10 and above. Returns the integer value of key, or 0. gtk.PrintSettings.get_int_with_default get_int_with_default key def key : a key def : the default value Returns : the integer value of key This 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_int set_int key value key : a key value : an integer This method is available in PyGTK 2.10 and above. Sets key to the given integer value. gtk.PrintSettings.get_printer get_printer Returns : the printer name This method is available in PyGTK 2.10 and above. Convenience method to obtain the value of the "printer" key. gtk.PrintSettings.set_printer set_printer printer printer : the printer name This method is available in PyGTK 2.10 and above. Convenience function to set the "printer" key the value specified by printer. gtk.PrintSettings.get_orientation get_orientation Returns : the orientation This method is available in PyGTK 2.10 and above. Get the value of the "orientation" key, converted to one of the . gtk.PrintSettings.set_orientation set_orientation orientation orientation : a page orientation This 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_size get_paper_size Returns : the paper size This 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_size set_paper_size paper_size paper_size : a paper size This 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_width get_paper_width unit unit : the unit for the return value Returns : the paper width, in units of unit This 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_width set_paper_width width unit width : the paper width unit : the units of width This 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_height get_paper_height unit unit : the units for the return value Returns : the paper height, in units of unit This 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_height set_paper_height height unit height : the paper height unit : the units of height This 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_color get_use_color Returns : whether to use color This 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_color set_use_color use_color use_color : if True use color This 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_collate get_collate Returns : True if the printed pages are to be collated This method is available in PyGTK 2.10 and above. Returns the value of the "collate" key. gtk.PrintSettings.set_collate set_collate collate collate : if True, collate the output This 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_reverse get_reverse Returns : 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_reverse set_reverse reverse reverse : if True reverse the output This 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_duplex get_duplex Returns : 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_duplex set_duplex duplex duplex : 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_quality get_quality Returns : the print quality This method is available in PyGTK 2.10 and above. Returns the value of the "quality" key. gtk.PrintSettings.set_quality set_quality quality quality : 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_copies get_n_copies Returns : the number of copies to print This method is available in PyGTK 2.10 and above. Returns the value of the "n-copies" key. gtk.PrintSettings.set_n_copies set_n_copies num_copies num_copies : the number of copies This 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_up get_number_up Returns : the number of pages per sheet This 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_up set_number_up number_up number_up : the number of pages per sheet This 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_resolution get_resolution Returns : the resolution in dpi This method is available in PyGTK 2.10 and above. Returns the value of the "resolution" key in dpi. gtk.PrintSettings.set_resolution set_resolution resolution resolution : the resolution in dpi This method is available in PyGTK 2.10 and above. Sets the value of the "resolution" key in dpi. gtk.PrintSettings.get_scale get_scale Returns : the scale in percent This method is available in PyGTK 2.10 and above. Returns the value of the "scale" key as a float number. gtk.PrintSettings.set_scale set_scale scale scale : the scale in percent This 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_pages get_print_pages Returns : which pages to print This 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_pages set_print_pages pages pages : 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_ranges get_page_ranges Returns : a list of [age ranges as 2-tuples This 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_ranges set_page_ranges page_ranges num_ranges page_ranges : a sequence of page range 2-tuples This 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_set get_page_set Returns : the set of pages to print This 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_set set_page_set page_set page_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_source get_default_source Returns : the default source This method is available in PyGTK 2.10 and above. Returns the value of the "default-source" key. gtk.PrintSettings.set_default_source set_default_source default_source default_source : the default source This 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_type get_media_type Returns : the media type This 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_type set_media_type media_type media_type : the media type This 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_dither get_dither Returns : the dithering that is used This method is available in PyGTK 2.10 and above. Returns the value of the "dither" key. gtk.PrintSettings.set_dither set_dither dither dither : the dithering that is used This 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_finishings get_finishings Returns : the finishings This method is available in PyGTK 2.10 and above. Returns the value of the "finishings" key. gtk.PrintSettings.set_finishings set_finishings finishings finishings : the finishings This 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_bin get_output_bin Returns : the output bin This method is available in PyGTK 2.10 and above. Returns the value of the "output-bin" key. gtk.PrintSettings.set_output_bin set_output_bin output_bin output_bin : the output bin This 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_file to_file file_name filename : 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_layout get_number_up_layout Returns : layout of page in number-up mode. This method is available in PyGTK 2.16 and above. gtk.PrintSettings.set_number_up_layout set_number_up_layout number_up_layout number_up_layout : a GtkNumberUpLayout constant value. This method is available in PyGTK 2.16 and above. Sets the value of GtkNumberUpLayout. gtk.PrintSettings.load_file load_file file_name file_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_x get_resolution_x Returns : 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_y get_resolution_y Returns : 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_xy set_resolution_xy resolution_x resolution_y resolution_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_lpi get_printer_lpi Returns : 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_lpi set_printer_lpi lpi lpi : 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. Functions gtk.print_settings_new_from_file gtk.print_settings_new_from_file file_name file_name : the filename to read the settings from. Returns : the restored gtk.PrintSettings This 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().