.. include:: headings.inc .. _PrintData: ========================================================================================================================================== |phoenix_title| **PrintData** ========================================================================================================================================== This class holds a variety of information related to printers and printer device contexts. This class is used to create a :ref:`PrinterDC` and a :ref:`PostScriptDC`. It is also used as a data member of :ref:`PrintDialogData` and :ref:`PageSetupDialogData`, as part of the mechanism for transferring data between the print dialogs and the application. The following functions are specific to PostScript printing and have not yet been documented: .. seealso:: :ref:`Printing Framework Overview `, :ref:`PrintDialog`, :ref:`PageSetupDialog`, :ref:`PrintDialogData`, :ref:`PageSetupDialogData`, :ref:`PrintDialog Overview `, :ref:`PrinterDC`, :ref:`PostScriptDC` | |class_hierarchy| Inheritance Diagram ===================================== Inheritance diagram for class **PrintData** .. raw:: html

Inheritance diagram of PrintData

| |method_summary| Methods Summary ================================ ================================================================================ ================================================================================ :meth:`~PrintData.__init__` Default constructor. :meth:`~PrintData.GetBin` Returns the current bin (papersource). :meth:`~PrintData.GetCollate` Returns ``True`` if collation is on. :meth:`~PrintData.GetColour` Returns ``True`` if colour printing is on. :meth:`~PrintData.GetDuplex` Returns the duplex mode. :meth:`~PrintData.GetFilename` :meth:`~PrintData.GetNoCopies` Returns the number of copies requested by the user. :meth:`~PrintData.GetOrientation` Gets the orientation. :meth:`~PrintData.GetPaperId` Returns the paper size id. :meth:`~PrintData.GetPrintMode` :meth:`~PrintData.GetPrinterName` Returns the printer name. :meth:`~PrintData.GetPrivData` :meth:`~PrintData.GetQuality` Returns the current print quality. :meth:`~PrintData.IsOk` Returns ``True`` if the print data is valid for using in print dialogs. :meth:`~PrintData.SetBin` Sets the current bin. :meth:`~PrintData.SetCollate` Sets collation to on or off. :meth:`~PrintData.SetColour` Sets colour printing on or off. :meth:`~PrintData.SetDuplex` Returns the duplex mode. :meth:`~PrintData.SetFilename` :meth:`~PrintData.SetNoCopies` Sets the default number of copies to be printed out. :meth:`~PrintData.SetOrientation` Sets the orientation. :meth:`~PrintData.SetPaperId` Sets the paper id. :meth:`~PrintData.SetPrintMode` :meth:`~PrintData.SetPrinterName` Sets the printer name. :meth:`~PrintData.SetPrivData` :meth:`~PrintData.SetQuality` Sets the desired print quality. :meth:`~PrintData.__nonzero__` ================================================================================ ================================================================================ | |property_summary| Properties Summary ===================================== ================================================================================ ================================================================================ :attr:`~PrintData.Bin` See :meth:`~PrintData.GetBin` and :meth:`~PrintData.SetBin` :attr:`~PrintData.Collate` See :meth:`~PrintData.GetCollate` and :meth:`~PrintData.SetCollate` :attr:`~PrintData.Colour` See :meth:`~PrintData.GetColour` and :meth:`~PrintData.SetColour` :attr:`~PrintData.Duplex` See :meth:`~PrintData.GetDuplex` and :meth:`~PrintData.SetDuplex` :attr:`~PrintData.Filename` See :meth:`~PrintData.GetFilename` and :meth:`~PrintData.SetFilename` :attr:`~PrintData.NoCopies` See :meth:`~PrintData.GetNoCopies` and :meth:`~PrintData.SetNoCopies` :attr:`~PrintData.Orientation` See :meth:`~PrintData.GetOrientation` and :meth:`~PrintData.SetOrientation` :attr:`~PrintData.PaperId` See :meth:`~PrintData.GetPaperId` and :meth:`~PrintData.SetPaperId` :attr:`~PrintData.PrintMode` See :meth:`~PrintData.GetPrintMode` and :meth:`~PrintData.SetPrintMode` :attr:`~PrintData.PrinterName` See :meth:`~PrintData.GetPrinterName` and :meth:`~PrintData.SetPrinterName` :attr:`~PrintData.PrivData` See :meth:`~PrintData.GetPrivData` and :meth:`~PrintData.SetPrivData` :attr:`~PrintData.Quality` See :meth:`~PrintData.GetQuality` and :meth:`~PrintData.SetQuality` ================================================================================ ================================================================================ | |api| Class API =============== .. class:: PrintData(Object) This class holds a variety of information related to printers and printer device contexts. **Possible constructors**:: PrintData() PrintData(data) .. method:: __init__(self, *args, **kw) |overload| **Overloaded Implementations**: **~~~** **__init__** `(self)` Default constructor. **~~~** **__init__** `(self, data)` Copy constructor. :param `data`: :type `data`: PrintData **~~~** .. 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:`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 ``DUPLEX_SIMPLEX``, ``DUPLEX_HORIZONTAL``, ``DUPLEX_VERTICAL``. :rtype: :ref:`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 ``LANDSCAPE`` or ``PORTRAIT``. :rtype: :ref:`PrintOrientation` .. method:: GetPaperId(self) Returns the paper size id. :rtype: :ref:`PaperSize` .. seealso:: :meth:`SetPaperId` .. method:: GetPrintMode(self) :rtype: :ref:`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: - ``PRINT_QUALITY_HIGH`` - ``PRINT_QUALITY_MEDIUM`` - ``PRINT_QUALITY_LOW`` - ``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: `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`: 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 ``DUPLEX_SIMPLEX``, ``DUPLEX_HORIZONTAL``, ``DUPLEX_VERTICAL``. :param `mode`: :type `mode`: 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 ``LANDSCAPE`` or ``PORTRAIT``. :param `orientation`: :type `orientation`: 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`: PaperSize .. method:: SetPrintMode(self, printMode) :param `printMode`: :type `printMode`: 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: - ``PRINT_QUALITY_HIGH`` - ``PRINT_QUALITY_MEDIUM`` - ``PRINT_QUALITY_LOW`` - ``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`: PrintQuality .. method:: __nonzero__(self) :rtype: `int` .. attribute:: Bin See :meth:`~PrintData.GetBin` and :meth:`~PrintData.SetBin` .. attribute:: Collate See :meth:`~PrintData.GetCollate` and :meth:`~PrintData.SetCollate` .. attribute:: Colour See :meth:`~PrintData.GetColour` and :meth:`~PrintData.SetColour` .. attribute:: Duplex See :meth:`~PrintData.GetDuplex` and :meth:`~PrintData.SetDuplex` .. attribute:: Filename See :meth:`~PrintData.GetFilename` and :meth:`~PrintData.SetFilename` .. attribute:: NoCopies See :meth:`~PrintData.GetNoCopies` and :meth:`~PrintData.SetNoCopies` .. attribute:: Orientation See :meth:`~PrintData.GetOrientation` and :meth:`~PrintData.SetOrientation` .. attribute:: PaperId See :meth:`~PrintData.GetPaperId` and :meth:`~PrintData.SetPaperId` .. attribute:: PrintMode See :meth:`~PrintData.GetPrintMode` and :meth:`~PrintData.SetPrintMode` .. attribute:: PrinterName See :meth:`~PrintData.GetPrinterName` and :meth:`~PrintData.SetPrinterName` .. attribute:: PrivData See :meth:`~PrintData.GetPrivData` and :meth:`~PrintData.SetPrivData` .. attribute:: Quality See :meth:`~PrintData.GetQuality` and :meth:`~PrintData.SetQuality`