Package pycocoa :: Module printers :: Class Printer
[frames] | no frames]

Class Printer

          object --+            
                   |            
internals._Objectype --+        
                       |        
        baseTypes._Type0 --+    
                           |    
                   _PM_Type0 --+
                               |
                              Printer

Python Printer Type, wrapping ObjC NSPrinter and PMPrinter.

Instance Methods
 
__init__(self, name_ns_pm=None)
New Printer from a printer name (str), NSPrinter or PMPrinter.
 
printView(self, PMview, toPDF='', wait=True)
Print an ObjC NSView or PMview.
 
setDefault(self)
Make this printer the default printer (bool).

Inherited from _PM_Type0: __str__, release, retain

Inherited from baseTypes._Type0: __repr__, type2strepr

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Properties
  description
Get printer description (json).
  deviceDescription
Get the NSDevice description (Adict).
  deviceURI
Get the printer device (URI) or "".
  ID
Get the printer IDentifier (str) or "".
  isColor
Is printer color (bool).
  isDefault
Is this the default printer (bool).
  isRemote
Is this a remote printer (bool).
  location
Get the printer location (str) or "".
  makemodel
Get the printer make and model (str) or "".
  name
Get the printer name (str) or "".
  NS
Get the ObjC instance (NSPrinter).
  papers
Yield each paper available (Paper).
  PPD
Get the printer PPD description (URL).
  psCapable
Is the printer PostScript capable (bool).
  psLevel
Get the printer's PostScript language level (int).
  resolution
Get the highest (horizontal, vertical) resolution supported by this printer (floats, dots-per-inch).

Inherited from _PM_Type0: PM

Inherited from baseTypes._Type0: NSDelegate

Inherited from internals._Objectype: typename

Inherited from object: __class__

Method Details

__init__(self, name_ns_pm=None)
(Constructor)

 

New Printer from a printer name (str), NSPrinter or PMPrinter.

Raises:
  • TypeError - Invalid name_ns_pm.
  • PrintError - No printer with name name_ns_pm.
Overrides: object.__init__

printView(self, PMview, toPDF='', wait=True)

 

Print an ObjC NSView or PMview.

Parameters:
  • PMview - The ObjC view to print (NSView or PMview).
  • toPDF - Save as PDF file name (str).
  • wait - Wait for print completion (bool).
Returns:
True if printing succeeded, False if printing failed or None if ignored.
Raises:
  • PrintError - If toPDF file exists.
  • TypeError - Invalid PMview.

setDefault(self)

 

Make this printer the default printer (bool).

Returns:
True if set, False otherwise

Property Details

description

Get printer description (json).

Get Method:
description(self) - Get printer description (json).
Set Method:
Read_Only(inst, value) - Throws an AttributeError, always.

deviceDescription

Get the NSDevice description (Adict).

Get Method:
deviceDescription(self) - Get the NSDevice description (Adict).
Set Method:
Read_Only(inst, value) - Throws an AttributeError, always.

deviceURI

Get the printer device (URI) or "".

Get Method:
deviceURI(self) - Get the printer device (URI) or "".
Set Method:
Read_Only(inst, value) - Throws an AttributeError, always.

ID

Get the printer IDentifier (str) or "".

Get Method:
ID(self) - Get the printer IDentifier (str) or "".
Set Method:
Read_Only(inst, value) - Throws an AttributeError, always.

isColor

Is printer color (bool).

Get Method:
isColor(self) - Is printer color (bool).
Set Method:
Read_Only(inst, value) - Throws an AttributeError, always.

isDefault

Is this the default printer (bool).

Get Method:
isDefault(self) - Is this the default printer (bool).
Set Method:
Read_Only(inst, value) - Throws an AttributeError, always.

isRemote

Is this a remote printer (bool).

Get Method:
isRemote(self) - Is this a remote printer (bool).
Set Method:
Read_Only(inst, value) - Throws an AttributeError, always.

location

Get the printer location (str) or "".

Get Method:
location(self) - Get the printer location (str) or "".
Set Method:
Read_Only(inst, value) - Throws an AttributeError, always.

makemodel

Get the printer make and model (str) or "".

Get Method:
makemodel(self) - Get the printer make and model (str) or "".
Set Method:
Read_Only(inst, value) - Throws an AttributeError, always.

name

Get the printer name (str) or "".

Get Method:
name(self) - Get the printer name (str) or "".
Set Method:
Read_Only(inst, value) - Throws an AttributeError, always.

NS

Get the ObjC instance (NSPrinter).

Get Method:
NS(self) - Get the ObjC instance (NSPrinter).
Set Method:
Read_Only(inst, value) - Throws an AttributeError, always.

papers

Yield each paper available (Paper).

Get Method:
papers(self) - Yield each paper available (Paper).
Set Method:
Read_Only(inst, value) - Throws an AttributeError, always.

PPD

Get the printer PPD description (URL).

Get Method:
PPD(self) - Get the printer PPD description (URL).
Set Method:
Read_Only(inst, value) - Throws an AttributeError, always.

psCapable

Is the printer PostScript capable (bool).

Get Method:
psCapable(self) - Is the printer PostScript capable (bool).
Set Method:
Read_Only(inst, value) - Throws an AttributeError, always.

psLevel

Get the printer's PostScript language level (int).

Get Method:
psLevel(self) - Get the printer's PostScript language level (int).
Set Method:
Read_Only(inst, value) - Throws an AttributeError, always.

resolution

Get the highest (horizontal, vertical) resolution supported by this printer (floats, dots-per-inch).

Get Method:
resolution(self) - Get the highest (horizontal, vertical) resolution supported by this printer (floats, dots-per-inch).
Set Method:
Read_Only(inst, value) - Throws an AttributeError, always.