.. wxPython Phoenix documentation This file was generated by Phoenix's sphinx generator and associated tools, do not edit by hand. Copyright: (c) 2011-2020 by Total Control Software License: wxWindows License .. include:: headings.inc .. _wx.PrintData: ========================================================================================================================================== |phoenix_title| **wx.PrintData** ========================================================================================================================================== This class holds a variety of information related to printers and printer device contexts. This class is used to create a :ref:`wx.PrinterDC` and a :ref:`wx.PostScriptDC`. It is also used as a data member of :ref:`wx.PrintDialogData` and :ref:`wx.PageSetupDialogData`, as part of the mechanism for transferring data between the print dialogs and the application. .. seealso:: :ref:`Printing Framework Overview `, :ref:`wx.PrintDialog`, :ref:`wx.PageSetupDialog`, :ref:`wx.PrintDialogData`, :ref:`wx.PageSetupDialogData`, :ref:`PrintDialog Overview `, :ref:`wx.PrinterDC`, :ref:`wx.PostScriptDC` | |class_hierarchy| Class Hierarchy ================================= .. raw:: html
Inheritance diagram for class PrintData:
| |method_summary| Methods Summary ================================ ================================================================================ ================================================================================ :meth:`~wx.PrintData.__init__` Default constructor. :meth:`~wx.PrintData.GetBin` Returns the current bin (papersource). :meth:`~wx.PrintData.GetCollate` Returns ``True`` if collation is on. :meth:`~wx.PrintData.GetColour` Returns ``True`` if colour printing is on. :meth:`~wx.PrintData.GetDuplex` Returns the duplex mode. :meth:`~wx.PrintData.GetFilename` :meth:`~wx.PrintData.GetNoCopies` Returns the number of copies requested by the user. :meth:`~wx.PrintData.GetOrientation` Gets the orientation. :meth:`~wx.PrintData.GetPaperId` Returns the paper size id. :meth:`~wx.PrintData.GetPaperSize` :meth:`~wx.PrintData.GetPrintMode` :meth:`~wx.PrintData.GetPrinterName` Returns the printer name. :meth:`~wx.PrintData.GetPrivData` :meth:`~wx.PrintData.GetQuality` Returns the current print quality. :meth:`~wx.PrintData.IsOk` Returns ``True`` if the print data is valid for using in print dialogs. :meth:`~wx.PrintData.SetBin` Sets the current bin. :meth:`~wx.PrintData.SetCollate` Sets collation to on or off. :meth:`~wx.PrintData.SetColour` Sets colour printing on or off. :meth:`~wx.PrintData.SetDuplex` Returns the duplex mode. :meth:`~wx.PrintData.SetFilename` :meth:`~wx.PrintData.SetNoCopies` Sets the default number of copies to be printed out. :meth:`~wx.PrintData.SetOrientation` Sets the orientation. :meth:`~wx.PrintData.SetPaperId` Sets the paper id. :meth:`~wx.PrintData.SetPaperSize` Sets custom paper size. :meth:`~wx.PrintData.SetPrintMode` :meth:`~wx.PrintData.SetPrinterName` Sets the printer name. :meth:`~wx.PrintData.SetPrivData` :meth:`~wx.PrintData.SetQuality` Sets the desired print quality. :meth:`~wx.PrintData.__bool__` :meth:`~wx.PrintData.__nonzero__` ================================================================================ ================================================================================ | |property_summary| Properties Summary ===================================== ================================================================================ ================================================================================ :attr:`~wx.PrintData.Bin` See :meth:`~wx.PrintData.GetBin` and :meth:`~wx.PrintData.SetBin` :attr:`~wx.PrintData.Collate` See :meth:`~wx.PrintData.GetCollate` and :meth:`~wx.PrintData.SetCollate` :attr:`~wx.PrintData.Colour` See :meth:`~wx.PrintData.GetColour` and :meth:`~wx.PrintData.SetColour` :attr:`~wx.PrintData.Duplex` See :meth:`~wx.PrintData.GetDuplex` and :meth:`~wx.PrintData.SetDuplex` :attr:`~wx.PrintData.Filename` See :meth:`~wx.PrintData.GetFilename` and :meth:`~wx.PrintData.SetFilename` :attr:`~wx.PrintData.NoCopies` See :meth:`~wx.PrintData.GetNoCopies` and :meth:`~wx.PrintData.SetNoCopies` :attr:`~wx.PrintData.Orientation` See :meth:`~wx.PrintData.GetOrientation` and :meth:`~wx.PrintData.SetOrientation` :attr:`~wx.PrintData.PaperId` See :meth:`~wx.PrintData.GetPaperId` and :meth:`~wx.PrintData.SetPaperId` :attr:`~wx.PrintData.PaperSize` See :meth:`~wx.PrintData.GetPaperSize` and :meth:`~wx.PrintData.SetPaperSize` :attr:`~wx.PrintData.PrintMode` See :meth:`~wx.PrintData.GetPrintMode` and :meth:`~wx.PrintData.SetPrintMode` :attr:`~wx.PrintData.PrinterName` See :meth:`~wx.PrintData.GetPrinterName` and :meth:`~wx.PrintData.SetPrinterName` :attr:`~wx.PrintData.PrivData` See :meth:`~wx.PrintData.GetPrivData` and :meth:`~wx.PrintData.SetPrivData` :attr:`~wx.PrintData.Quality` See :meth:`~wx.PrintData.GetQuality` and :meth:`~wx.PrintData.SetQuality` ================================================================================ ================================================================================ | |api| Class API =============== .. class:: wx.PrintData(Object) **Possible constructors**:: PrintData() PrintData(data) This class holds a variety of information related to printers and printer device contexts. .. method:: __init__(self, *args, **kw) |overload| Overloaded Implementations: :html:`

` **__init__** `(self)` Default constructor. :html:`

` **__init__** `(self, data)` Copy constructor. :param `data`: :type `data`: wx.PrintData :html:`

` .. method:: GetBin(self) Returns the current bin (papersource). By default, the system is left to select the bin ( ``PRINTBIN_DEFAULT`` is returned). See :meth:`SetBin` for the full list of bin values. :rtype: :ref:`wx.PrintBin` .. method:: GetCollate(self) Returns ``True`` if collation is on. :rtype: `bool` .. method:: GetColour(self) Returns ``True`` if colour printing is on. :rtype: `bool` .. method:: GetDuplex(self) Returns the duplex mode. One of ``wx.DUPLEX_SIMPLEX``, ``wx.DUPLEX_HORIZONTAL``, ``wx.DUPLEX_VERTICAL``. :rtype: :ref:`wx.DuplexMode` .. method:: GetFilename(self) :rtype: `string` .. method:: GetNoCopies(self) Returns the number of copies requested by the user. :rtype: `int` .. method:: GetOrientation(self) Gets the orientation. This can be ``wx.LANDSCAPE`` or ``wx.PORTRAIT``. :rtype: :ref:`wx.PrintOrientation` .. method:: GetPaperId(self) Returns the paper size id. :rtype: :ref:`wx.PaperSize` .. seealso:: :meth:`SetPaperId` .. method:: GetPaperSize(self) :rtype: :ref:`wx.Size` .. method:: GetPrintMode(self) :rtype: :ref:`wx.PrintMode` .. method:: GetPrinterName(self) Returns the printer name. If the printer name is the empty string, it indicates that the default printer should be used. :rtype: `string` .. method:: GetPrivData(self) :rtype: `PyObject` .. method:: GetQuality(self) Returns the current print quality. This can be a positive integer, denoting the number of dots per inch, or one of the following identifiers: - ``wx.PRINT_QUALITY_HIGH`` - ``wx.PRINT_QUALITY_MEDIUM`` - ``wx.PRINT_QUALITY_LOW`` - ``wx.PRINT_QUALITY_DRAFT`` On input you should pass one of these identifiers, but on return you may get back a positive integer indicating the current resolution setting. :rtype: `wx.PrintQuality` .. method:: IsOk(self) Returns ``True`` if the print data is valid for using in print dialogs. This can return ``False`` on Windows if the current printer is not set, for example. On all other platforms, it returns ``True``. :rtype: `bool` .. method:: SetBin(self, flag) Sets the current bin. :param `flag`: :type `flag`: wx.PrintBin .. method:: SetCollate(self, flag) Sets collation to on or off. :param `flag`: :type `flag`: bool .. method:: SetColour(self, flag) Sets colour printing on or off. :param `flag`: :type `flag`: bool .. method:: SetDuplex(self, mode) Returns the duplex mode. One of ``wx.DUPLEX_SIMPLEX``, ``wx.DUPLEX_HORIZONTAL``, ``wx.DUPLEX_VERTICAL``. :param `mode`: :type `mode`: wx.DuplexMode .. method:: SetFilename(self, filename) :param `filename`: :type `filename`: string .. method:: SetNoCopies(self, n) Sets the default number of copies to be printed out. :param `n`: :type `n`: int .. method:: SetOrientation(self, orientation) Sets the orientation. This can be ``wx.LANDSCAPE`` or ``wx.PORTRAIT``. :param `orientation`: :type `orientation`: wx.PrintOrientation .. method:: SetPaperId(self, paperId) Sets the paper id. This indicates the type of paper to be used. For a mapping between paper id, paper size and string name, see PrintPaperDatabase in ``"paper.h"`` (not yet documented). :param `paperId`: :type `paperId`: wx.PaperSize .. seealso:: :meth:`SetPaperSize` .. method:: SetPaperSize(self, *args, **kw) |overload| Overloaded Implementations: :html:`

` **SetPaperSize** `(self, size)` Sets custom paper size. This method can be used to set up custom paper size. When using a standard size, prefer to use :meth:`SetPaperId` instead. :param `size`: :type `size`: wx.Size :html:`

` **SetPaperSize** `(self, sz)` :html:`

` .. method:: SetPrintMode(self, printMode) :param `printMode`: :type `printMode`: wx.PrintMode .. method:: SetPrinterName(self, printerName) Sets the printer name. This can be the empty string to indicate that the default printer should be used. :param `printerName`: :type `printerName`: string .. method:: SetPrivData(self, data) .. method:: SetQuality(self, quality) Sets the desired print quality. This can be a positive integer, denoting the number of dots per inch, or one of the following identifiers: - ``wx.PRINT_QUALITY_HIGH`` - ``wx.PRINT_QUALITY_MEDIUM`` - ``wx.PRINT_QUALITY_LOW`` - ``wx.PRINT_QUALITY_DRAFT`` On input you should pass one of these identifiers, but on return you may get back a positive integer indicating the current resolution setting. :param `quality`: :type `quality`: wx.PrintQuality .. method:: __bool__(self) :rtype: `int` .. method:: __nonzero__(self) :rtype: `int` .. attribute:: Bin See :meth:`~wx.PrintData.GetBin` and :meth:`~wx.PrintData.SetBin` .. attribute:: Collate See :meth:`~wx.PrintData.GetCollate` and :meth:`~wx.PrintData.SetCollate` .. attribute:: Colour See :meth:`~wx.PrintData.GetColour` and :meth:`~wx.PrintData.SetColour` .. attribute:: Duplex See :meth:`~wx.PrintData.GetDuplex` and :meth:`~wx.PrintData.SetDuplex` .. attribute:: Filename See :meth:`~wx.PrintData.GetFilename` and :meth:`~wx.PrintData.SetFilename` .. attribute:: NoCopies See :meth:`~wx.PrintData.GetNoCopies` and :meth:`~wx.PrintData.SetNoCopies` .. attribute:: Orientation See :meth:`~wx.PrintData.GetOrientation` and :meth:`~wx.PrintData.SetOrientation` .. attribute:: PaperId See :meth:`~wx.PrintData.GetPaperId` and :meth:`~wx.PrintData.SetPaperId` .. attribute:: PaperSize See :meth:`~wx.PrintData.GetPaperSize` and :meth:`~wx.PrintData.SetPaperSize` .. attribute:: PrintMode See :meth:`~wx.PrintData.GetPrintMode` and :meth:`~wx.PrintData.SetPrintMode` .. attribute:: PrinterName See :meth:`~wx.PrintData.GetPrinterName` and :meth:`~wx.PrintData.SetPrinterName` .. attribute:: PrivData See :meth:`~wx.PrintData.GetPrivData` and :meth:`~wx.PrintData.SetPrivData` .. attribute:: Quality See :meth:`~wx.PrintData.GetQuality` and :meth:`~wx.PrintData.SetQuality`