gtk.PageSetup an object that stores page setup information (new in PyGTK 2.10) Synopsis gtk.PageSetup gobject.GObject gtk.PageSetup copy get_orientation set_orientation orientation get_paper_size set_paper_size size get_top_margin unit set_top_margin margin unit get_bottom_margin unit set_bottom_margin margin unit get_left_margin unit set_left_margin margin unit get_right_margin unit set_right_margin margin unit set_paper_size_and_default_margins size get_paper_width unit get_paper_height unit get_page_width unit get_page_height unit to_file file_name load_file file_name Functions gtk.print_run_page_setup_dialog parent page_setup settings gtk.page_setup_new_from_file file_name Ancestry +-- gobject.GObject +-- gtk.PageSetup gtk.PageSetup Signal Prototypes gobject.GObject Signal Prototypes Description This class is available in PyGTK 2.10 and above. A gtk.PageSetup object stores the page size, orientation and margins. The idea is that you can get one of these from the page setup dialog and then pass it to the gtk.PrintOperation when printing. The benefit of splitting this out of the gtk.PrintSettings is that these affect the actual layout of the page, and thus need to be set long before user prints. The margins specified in this object are the "print margins", i.e. the parts of the page that the printer cannot print on. These are different from the layout margins that a word processor uses; they are typically used to determine the minimal size for the layout margins. To obtain a gtk.PageSetup use the gtk.PageSetup() constructor to get the defaults, or use the gtk.print_run_page_setup_dialog() function to show the page setup dialog and receive the resulting page setup. An example page setup function is: def do_page_setup(): if settings == None: settings = gtk.PrintSettings() page_setup = gtk.print_run_page_setup_dialog(main_window, page_setup, settings) Constructor gtk.PageSetup gtk.PageSetup Returns : a new gtk.PageSetup. This constructor is available in PyGTK 2.10 and above. Creates a new gtk.PageSetup. Methods gtk.PageSetup.copy copy Returns : a copy of this page setup This method is available in PyGTK 2.10 and above. The copy() method copies this gtk.PageSetup. gtk.PageSetup.get_orientation get_orientation Returns : the page orientation This method is available in PyGTK 2.10 and above. The get_orientation() method returns the page orientation of the gtk.PageSetup. The return value must be one of the . gtk.PageSetup.set_orientation set_orientation orientation orientation : one of the This method is available in PyGTK 2.10 and above. The set_orientation() method sets the page orientation of the gtk.PageSetup to the value specified by orientation. The value of orientation must be one of the gtk.PageSetup.get_paper_size get_paper_size Returns : the paper size This method is available in PyGTK 2.10 and above. The get_paper_size() method gets the paper size of the gtk.PageSetup. gtk.PageSetup.set_paper_size set_paper_size size size : a gtk.PaperSize This method is available in PyGTK 2.10 and above. The set_paper_size() method sets the paper size of the page setup without changing the margins. See the set_paper_size_and_default_margins() method. gtk.PageSetup.get_top_margin get_top_margin unit unit : the unit for the return value - one of the Returns : the top margin This method is available in PyGTK 2.10 and above. The get_top_margin() method returns the top margin in units of unit. gtk.PageSetup.set_top_margin set_top_margin margin unit margin : the new top margin in units of unit unit : the units for margin - one of the This method is available in PyGTK 2.10 and above. The set_top_margin() method sets the top margin of the page setup to the value specified by margin in the units specified by unit. gtk.PageSetup.get_bottom_margin get_bottom_margin unit unit : the unit for the return value Returns : the bottom margin This method is available in PyGTK 2.10 and above. The get_bottom_margin() method gets the bottom margin in units of unit. gtk.PageSetup.set_bottom_margin set_bottom_margin margin unit margin : the new bottom margin in units of unit unit : the units for margin - one of the This method is available in PyGTK 2.10 and above. The set_bottom_margin() method sets the bottom margin of the page setup to the value specified by margin using the units specified by unit. gtk.PageSetup.get_left_margin get_left_margin unit unit : the unit for the return value Returns : the left margin This method is available in PyGTK 2.10 and above. The get_left_margin() method gets the left margin in units of unit. gtk.PageSetup.set_left_margin set_left_margin margin unit margin : the new left margin in units of unit unit : the units for margin - one of the This method is available in PyGTK 2.10 and above. The set_left_margin() method sets the left margin of the page setup to the value specified by margin using the units specified by unit. gtk.PageSetup.get_right_margin get_right_margin unit unit : the unit for the return value - one of the Returns : the right margin This method is available in PyGTK 2.10 and above. The get_right_margin() method gets the right margin in units of unit. gtk.PageSetup.set_right_margin set_right_margin margin unit margin : the new right margin in units of unit unit : the units for margin - one of the This method is available in PyGTK 2.10 and above. The set_right_margin() method sets the right margin of the page setup to the value specified by margin using the units specified by unit. gtk.PageSetup.set_paper_size_and_default_margins set_paper_size_and_default_margins size size : a gtk.PaperSize This method is available in PyGTK 2.10 and above. The set_paper_size_and_default_margins() method sets the paper size of the page setup to the value specified by size and modifies the margins according to the new paper size. gtk.PageSetup.get_paper_width get_paper_width unit unit : the unit for the return value - one of the Returns : the paper width. This method is available in PyGTK 2.10 and above. The get_paper_width() method returns the paper width in units of unit. Note that this function takes orientation, but not margins into consideration. See the get_page_width() method. gtk.PageSetup.get_paper_height get_paper_height unit unit : the unit for the return value - one of the Returns : the paper height. This method is available in PyGTK 2.10 and above. The get_paper_height() method returns the paper height in units of unit. Note that this function takes orientation, but not margins into consideration. See the get_page_height() method. gtk.PageSetup.get_page_width get_page_width unit unit : the unit for the return value - one of the Returns : the page width. This method is available in PyGTK 2.10 and above. The get_page_width() method returns the page width in units of unit. Note that this function takes orientation and margins into consideration. See the get_paper_width() method. gtk.PageSetup.get_page_height get_page_height unit unit : the unit for the return value - one of the Returns : the page height. This method is available in PyGTK 2.10 and above. The get_page_height() method returns the page height in units of unit. Note that this function takes orientation and margins into consideration. See the get_paper_height() method. gtk.PageSetup.to_file to_file file_name file_name : the file to save to Returns : True on success. This method is available in PyGTK 2.12 and above. The to_file() method saves the information from setup to file_name. gtk.PageSetup.load_file load_file file_name file_name : the filename to read the page setup from. Returns : True on success. This method is available in PyGTK 2.14 and above. The load_file() method Reads the page setup from the file file_name. See to_file. Functions gtk.print_run_page_setup_dialog gtk.print_run_page_setup_dialog parent page_setup settings parent : transient parent, or None page_setup : an existing gtk.PageSetup, or None settings : a gtk.PrintSettings Returns : a new gtk.PageSetup Runs a page setup dialog, letting the user modify the values from page_setup. If the user cancels the dialog, the returned gtk.PageSetup is identical to the passed in page_setup, otherwise it contains the modifications done in the dialog. Note that this function may use a recursive mainloop to show the page setup dialog. gtk.page_setup_new_from_file gtk.page_setup_new_from_file file_name file_name : the filename to read the page setup from. Returns : The restored gtk.PageSetup This function is available in PyGTK 2.12 and above. Reads the page setup from the file file_name. Returns a new gtk.PageSetup object with the restored page setup, or None if an error occurred. See gtk.PageSetup.to_file.