gtk.print_settings
Module for [PrintSettings] class
Types 3
A [gtk.print_settings.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.
Methods
PrintSettings self()Returns `this`, for use in `with` statements.PrintSettingsGidBuilder builder()Get builder for [gtk.print_settings.PrintSettings] Returns: New builder objectgtk.print_settings.PrintSettings newFromFile(string fileName)Reads the print settings from file_name.gtk.print_settings.PrintSettings newFromGvariant(glib.variant.Variant variant)Deserialize print settings from an a{sv} variant.gtk.print_settings.PrintSettings newFromKeyFile(glib.key_file.KeyFile keyFile, string groupName = null)Reads the print settings from the group groupname in keyfile.gtk.print_settings.PrintSettings copy()Copies a [gtk.print_settings.PrintSettings] object. Returns: a newly allocated copy of othervoid foreach_(gtk.types.PrintSettingsFunc func)Calls func for each key-value pair of settings.string get(string key)Looks up the string value associated with key.bool getBool(string key)Returns the boolean represented by the value that is associated with key.bool getCollate()Gets the value of [gtk.types.PRINTSETTINGSCOLLATE]. Returns: whether to collate the printed pagesstring getDefaultSource()Gets the value of [gtk.types.PRINTSETTINGSDEFAULT_SOURCE]. Returns: the default sourcestring getDither()Gets the value of [gtk.types.PRINTSETTINGSDITHER]. Returns: the dithering that is useddouble getDouble(string key)Returns the double value associated with key, or 0.double getDoubleWithDefault(string key, double def)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.gtk.types.PrintDuplex getDuplex()Gets the value of [gtk.types.PRINTSETTINGSDUPLEX]. Returns: whether to print the output in duplex.string getFinishings()Gets the value of [gtk.types.PRINTSETTINGSFINISHINGS]. Returns: the finishingsint getInt(string key)Returns the integer value of key, or 0.int getIntWithDefault(string key, int def)Returns the value of key, interpreted as an integer, or the default value.double getLength(string key, gtk.types.Unit unit)Returns the value associated with key, interpreted as a length.string getMediaType()Gets the value of [gtk.types.PRINTSETTINGSMEDIA_TYPE].int getNCopies()Gets the value of [gtk.types.PRINTSETTINGSN_COPIES]. Returns: the number of copies to printint getNumberUp()Gets the value of [gtk.types.PRINTSETTINGSNUMBER_UP]. Returns: the number of pages per sheetgtk.types.NumberUpLayout getNumberUpLayout()Gets the value of [gtk.types.PRINTSETTINGSNUMBERUPLAYOUT]. Returns: layout of page in number-up modegtk.types.PageOrientation getOrientation()Get the value of [gtk.types.PRINTSETTINGSORIENTATION], converted to a [gtk.types.PageOrientation]. Returns: the orientationstring getOutputBin()Gets the value of [gtk.types.PRINTSETTINGSOUTPUT_BIN]. Returns: the output bingtk.types.PageRange[] getPageRanges()Gets the value of [gtk.types.PRINTSETTINGSPAGE_RANGES]. Returns: an array of [gtk.types.PageRange]s. Use [glib.global.gfree] to free the array when it is no longer needed.gtk.types.PageSet getPageSet()Gets the value of [gtk.types.PRINTSETTINGSPAGE_SET]. Returns: the set of pages to printdouble getPaperHeight(gtk.types.Unit unit)Gets the value of [gtk.types.PRINTSETTINGSPAPER_HEIGHT], converted to unit.gtk.paper_size.PaperSize getPaperSize()Gets the value of [gtk.types.PRINTSETTINGSPAPERFORMAT], converted to a [gtk.papersize.PaperSize]. Returns: the paper sizedouble getPaperWidth(gtk.types.Unit unit)Gets the value of [gtk.types.PRINTSETTINGSPAPER_WIDTH], converted to unit.gtk.types.PrintPages getPrintPages()Gets the value of [gtk.types.PRINTSETTINGSPRINT_PAGES]. Returns: which pages to printstring getPrinter()Convenience function to obtain the value of [gtk.types.PRINTSETTINGSPRINTER]. Returns: the printer namedouble getPrinterLpi()Gets the value of [gtk.types.PRINTSETTINGSPRINTER_LPI]. Returns: the resolution in lpi (lines per inch)gtk.types.PrintQuality getQuality()Gets the value of [gtk.types.PRINTSETTINGSQUALITY]. Returns: the print qualityint getResolution()Gets the value of [gtk.types.PRINTSETTINGSRESOLUTION]. Returns: the resolution in dpiint getResolutionX()Gets the value of [gtk.types.PRINTSETTINGSRESOLUTION_X]. Returns: the horizontal resolution in dpiint getResolutionY()Gets the value of [gtk.types.PRINTSETTINGSRESOLUTION_Y]. Returns: the vertical resolution in dpibool getReverse()Gets the value of [gtk.types.PRINTSETTINGSREVERSE]. Returns: whether to reverse the order of the printed pagesdouble getScale()Gets the value of [gtk.types.PRINTSETTINGSSCALE]. Returns: the scale in percentbool getUseColor()Gets the value of [gtk.types.PRINTSETTINGSUSE_COLOR]. Returns: whether to use colorbool hasKey(string key)Returns true, if a value is associated with key.bool loadFile(string fileName)Reads the print settings from file_name.bool loadKeyFile(glib.key_file.KeyFile keyFile, string groupName = null)Reads the print settings from the group groupname in keyfile.void set(string key, string value = null)Associates value with key.void setBool(string key, bool value)Sets key to a boolean value.void setCollate(bool collate)Sets the value of [gtk.types.PRINTSETTINGSCOLLATE].void setDefaultSource(string defaultSource)Sets the value of [gtk.types.PRINTSETTINGSDEFAULT_SOURCE].void setDither(string dither)Sets the value of [gtk.types.PRINTSETTINGSDITHER].void setDouble(string key, double value)Sets key to a double value.void setDuplex(gtk.types.PrintDuplex duplex)Sets the value of [gtk.types.PRINTSETTINGSDUPLEX].void setFinishings(string finishings)Sets the value of [gtk.types.PRINTSETTINGSFINISHINGS].void setInt(string key, int value)Sets key to an integer value.void setLength(string key, double value, gtk.types.Unit unit)Associates a length in units of unit with key.void setMediaType(string mediaType)Sets the value of [gtk.types.PRINTSETTINGSMEDIA_TYPE].void setNCopies(int numCopies)Sets the value of [gtk.types.PRINTSETTINGSN_COPIES].void setNumberUp(int numberUp)Sets the value of [gtk.types.PRINTSETTINGSNUMBER_UP].void setNumberUpLayout(gtk.types.NumberUpLayout numberUpLayout)Sets the value of [gtk.types.PRINTSETTINGSNUMBERUPLAYOUT].void setOrientation(gtk.types.PageOrientation orientation)Sets the value of [gtk.types.PRINTSETTINGSORIENTATION].void setOutputBin(string outputBin)Sets the value of [gtk.types.PRINTSETTINGSOUTPUT_BIN].void setPageRanges(gtk.types.PageRange[] pageRanges)Sets the value of [gtk.types.PRINTSETTINGSPAGE_RANGES].void setPageSet(gtk.types.PageSet pageSet)Sets the value of [gtk.types.PRINTSETTINGSPAGE_SET].void setPaperHeight(double height, gtk.types.Unit unit)Sets the value of [gtk.types.PRINTSETTINGSPAPER_HEIGHT].void setPaperSize(gtk.paper_size.PaperSize paperSize)Sets the value of [gtk.types.PRINTSETTINGSPAPERFORMAT], [gtk.types.PRINTSETTINGSPAPERWIDTH] and [gtk.types.PRINTSETTINGSPAPER_HEIGHT].void setPaperWidth(double width, gtk.types.Unit unit)Sets the value of [gtk.types.PRINTSETTINGSPAPER_WIDTH].void setPrintPages(gtk.types.PrintPages pages)Sets the value of [gtk.types.PRINTSETTINGSPRINT_PAGES].void setPrinter(string printer)Convenience function to set [gtk.types.PRINTSETTINGSPRINTER] to printer.void setPrinterLpi(double lpi)Sets the value of [gtk.types.PRINTSETTINGSPRINTER_LPI].void setQuality(gtk.types.PrintQuality quality)Sets the value of [gtk.types.PRINTSETTINGSQUALITY].void setResolution(int resolution)Sets the values of [gtk.types.PRINTSETTINGSRESOLUTION], [gtk.types.PRINTSETTINGSRESOLUTIONX] and [gtk.types.PRINTSETTINGSRESOLUTIONY].void setResolutionXy(int resolutionX, int resolutionY)Sets the values of [gtk.types.PRINTSETTINGSRESOLUTION], [gtk.types.PRINTSETTINGSRESOLUTIONX] and [gtk.types.PRINTSETTINGSRESOLUTIONY].void setReverse(bool reverse)Sets the value of [gtk.types.PRINTSETTINGSREVERSE].void setScale(double scale)Sets the value of [gtk.types.PRINTSETTINGSSCALE].void setUseColor(bool useColor)Sets the value of [gtk.types.PRINTSETTINGSUSE_COLOR].bool toFile(string fileName)This function saves the print settings from settings to file_name.glib.variant.Variant toGvariant()Serialize print settings to an a{sv} variant. Returns: a new, floating, [glib.variant.Variant]void toKeyFile(glib.key_file.KeyFile keyFile, string groupName = null)This function adds the print settings from settings to key_file.void unset(string key)Removes any value associated with key.Fluent builder for [gtk.print_settings.PrintSettings]
Methods