Phoenix Logo

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 wx.PrinterDC and a wx.PostScriptDC. It is also used as a data member of wx.PrintDialogData and wx.PageSetupDialogData, as part of the mechanism for transferring data between the print dialogs and the application.


class_hierarchy Class Hierarchy

Inheritance diagram for class PrintData:


method_summary Methods Summary

__init__ Default constructor.
GetBin Returns the current bin (papersource).
GetCollate Returns True if collation is on.
GetColour Returns True if colour printing is on.
GetDuplex Returns the duplex mode.
GetFilename  
GetNoCopies Returns the number of copies requested by the user.
GetOrientation Gets the orientation.
GetPaperId Returns the paper size id.
GetPaperSize  
GetPrintMode  
GetPrinterName Returns the printer name.
GetPrivData  
GetQuality Returns the current print quality.
IsOk Returns True if the print data is valid for using in print dialogs.
SetBin Sets the current bin.
SetCollate Sets collation to on or off.
SetColour Sets colour printing on or off.
SetDuplex Returns the duplex mode.
SetFilename  
SetNoCopies Sets the default number of copies to be printed out.
SetOrientation Sets the orientation.
SetPaperId Sets the paper id.
SetPaperSize  
SetPrintMode  
SetPrinterName Sets the printer name.
SetPrivData  
SetQuality Sets the desired print quality.
__nonzero__  

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.


Methods



__init__(self, *args, **kw)

overload Overloaded Implementations:



__init__ (self)

Default constructor.



__init__ (self, data)

Copy constructor.

Parameters:data (wx.PrintData) –





GetBin(self)

Returns the current bin (papersource).

By default, the system is left to select the bin ( PRINTBIN_DEFAULT is returned).

See SetBin for the full list of bin values.

Return type: wx.PrintBin


GetCollate(self)

Returns True if collation is on.

Return type:bool


GetColour(self)

Returns True if colour printing is on.

Return type:bool


GetDuplex(self)

Returns the duplex mode.

One of wx.DUPLEX_SIMPLEX, wx.DUPLEX_HORIZONTAL, wx.DUPLEX_VERTICAL.

Return type: wx.DuplexMode


GetFilename(self)
Return type:string


GetNoCopies(self)

Returns the number of copies requested by the user.

Return type:int


GetOrientation(self)

Gets the orientation.

This can be wx.LANDSCAPE or wx.PORTRAIT.

Return type: wx.PrintOrientation


GetPaperId(self)

Returns the paper size id.

Return type: wx.PaperSize

See also

SetPaperId



GetPaperSize(self)
Return type: wx.Size


GetPrintMode(self)
Return type: wx.PrintMode


GetPrinterName(self)

Returns the printer name.

If the printer name is the empty string, it indicates that the default printer should be used.

Return type:string


GetPrivData(self)
Return type:PyObject


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.

Return type:wx.PrintQuality


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.

Return type:bool


SetBin(self, flag)

Sets the current bin.

Parameters:flag (PrintBin) –


SetCollate(self, flag)

Sets collation to on or off.

Parameters:flag (bool) –


SetColour(self, flag)

Sets colour printing on or off.

Parameters:flag (bool) –


SetDuplex(self, mode)

Returns the duplex mode.

One of wx.DUPLEX_SIMPLEX, wx.DUPLEX_HORIZONTAL, wx.DUPLEX_VERTICAL.

Parameters:mode (DuplexMode) –


SetFilename(self, filename)
Parameters:filename (string) –


SetNoCopies(self, n)

Sets the default number of copies to be printed out.

Parameters:n (int) –


SetOrientation(self, orientation)

Sets the orientation.

This can be wx.LANDSCAPE or wx.PORTRAIT.

Parameters:orientation (PrintOrientation) –


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).

Parameters:paperId (PaperSize) –


SetPaperSize(self, sz)


SetPrintMode(self, printMode)
Parameters:printMode (PrintMode) –


SetPrinterName(self, printerName)

Sets the printer name.

This can be the empty string to indicate that the default printer should be used.

Parameters:printerName (string) –


SetPrivData(self, data)


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.

Parameters:quality (wx.PrintQuality) –


__nonzero__(self)
Return type:int

Properties



Bin

See GetBin and SetBin



Collate

See GetCollate and SetCollate



Colour

See GetColour and SetColour



Duplex

See GetDuplex and SetDuplex



Filename

See GetFilename and SetFilename



NoCopies

See GetNoCopies and SetNoCopies



Orientation

See GetOrientation and SetOrientation



PaperId

See GetPaperId and SetPaperId



PaperSize

See GetPaperSize and SetPaperSize



PrintMode

See GetPrintMode and SetPrintMode



PrinterName

See GetPrinterName and SetPrinterName



PrivData

See GetPrivData and SetPrivData



Quality

See GetQuality and SetQuality