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.
See also
Printing Framework Overview, wx.PrintDialog, wx.PageSetupDialog, wx.PrintDialogData, wx.PageSetupDialogData, PrintDialog Overview, wx.PrinterDC, wx.PostScriptDC
Class Hierarchy¶
Methods Summary¶
Default constructor. |
|
Returns the current bin (papersource). |
|
Returns |
|
Returns |
|
Returns the duplex mode. |
|
Returns the number of copies requested by the user. |
|
Gets the orientation. |
|
Returns the paper size id. |
|
Returns the printer name. |
|
Returns the current print quality. |
|
Returns |
|
Sets the current bin. |
|
Sets collation to on or off. |
|
Sets colour printing on or off. |
|
Returns the duplex mode. |
|
Sets the default number of copies to be printed out. |
|
Sets the orientation. |
|
Sets the paper id. |
|
Sets custom paper size. |
|
Sets the printer name. |
|
Sets the desired print quality. |
|
Properties Summary¶
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
Class API¶
- class wx.PrintData(Object)¶
Possible constructors:
PrintData() -> None PrintData(data) -> None
This class holds a variety of information related to printers and printer device contexts.
Methods¶
- __init__(self, *args, **kw)¶
-
__init__ (self)
Default constructor.
- Return type:
None
__init__ (self, data)
Copy constructor.
- Parameters:
data (wx.PrintData)
- Return type:
None
- 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:
- 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:
- GetFilename(self)¶
- Return type:
str
- GetNoCopies(self)¶
Returns the number of copies requested by the user.
- Return type:
int
- GetOrientation(self)¶
Gets the orientation.
This can be
wx.LANDSCAPE
orwx.PORTRAIT
.- Return type:
- GetPaperId(self)¶
Returns the paper size id.
- Return type:
See also
- GetPrintMode(self)¶
- Return type:
- 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:
str
- GetPrivData(self)¶
- Return type:
Any
- 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 returnsTrue
.- Return type:
bool
- SetCollate(self, flag)¶
Sets collation to on or off.
- Parameters:
flag (bool)
- Return type:
None
- SetColour(self, flag)¶
Sets colour printing on or off.
- Parameters:
flag (bool)
- Return type:
None
- SetDuplex(self, mode)¶
Returns the duplex mode.
One of
wx.DUPLEX_SIMPLEX
,wx.DUPLEX_HORIZONTAL
,wx.DUPLEX_VERTICAL
.- Parameters:
mode (DuplexMode)
- Return type:
None
- SetFilename(self, filename)¶
- Parameters:
filename (string)
- Return type:
None
- SetNoCopies(self, n)¶
Sets the default number of copies to be printed out.
- Parameters:
n (int)
- Return type:
None
- SetOrientation(self, orientation)¶
Sets the orientation.
This can be
wx.LANDSCAPE
orwx.PORTRAIT
.- Parameters:
orientation (PrintOrientation)
- Return type:
None
- 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)
- Return type:
None
See also
- SetPaperSize(self, *args, **kw)¶
-
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
SetPaperId
instead.- Parameters:
size (wx.Size)
- Return type:
None
SetPaperSize (self, sz)
- Return type:
None
- 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)
- Return type:
None
- SetPrivData(self, data)¶
- Return type:
None
- 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)
- Return type:
None
- __bool__(self)¶
- Return type:
bool
- __nonzero__(self)¶
- Return type:
bool
Properties¶
- Collate¶
See
GetCollate
andSetCollate
- Filename¶
See
GetFilename
andSetFilename
- NoCopies¶
See
GetNoCopies
andSetNoCopies
- Orientation¶
See
GetOrientation
andSetOrientation
- PaperId¶
See
GetPaperId
andSetPaperId
- PaperSize¶
See
GetPaperSize
andSetPaperSize
- PrintMode¶
See
GetPrintMode
andSetPrintMode
- PrinterName¶
See
GetPrinterName
andSetPrinterName
- PrivData¶
See
GetPrivData
andSetPrivData
- Quality¶
See
GetQuality
andSetQuality