Table Of Contents

Previous topic

PrintBin

Next topic

PrintDialog

This Page

phoenix_title PrintData

This class holds a variety of information related to printers and printer device contexts.

This class is used to create a PrinterDC and a PostScriptDC. It is also used as a data member of PrintDialogData and 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:


class_hierarchy Inheritance Diagram

Inheritance diagram for class PrintData

Inheritance diagram of 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.
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.
SetPrintMode  
SetPrinterName Sets the printer name.
SetPrivData  
SetQuality Sets the desired print quality.
__nonzero__  

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)

Methods



__init__(self, *args, **kw)

overload Overloaded Implementations:



__init__ (self)

Default constructor.



__init__ (self, data)

Copy constructor.

Parameters:data (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: 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 DUPLEX_SIMPLEX, DUPLEX_HORIZONTAL, DUPLEX_VERTICAL.

Return type: 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 LANDSCAPE or PORTRAIT.

Return type: PrintOrientation


GetPaperId(self)

Returns the paper size id.

Return type: PaperSize

See also

SetPaperId



GetPrintMode(self)
Return type: 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:

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

Return type: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 DUPLEX_SIMPLEX, DUPLEX_HORIZONTAL, 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 LANDSCAPE or 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) –


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:

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

Parameters:quality (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



PrintMode

See GetPrintMode and SetPrintMode



PrinterName

See GetPrinterName and SetPrinterName



PrivData

See GetPrivData and SetPrivData



Quality

See GetQuality and SetQuality