com.esri.arcgis.output
Class Paper

java.lang.Object
  extended by com.esri.arcgis.output.Paper
All Implemented Interfaces:
com.esri.arcgis.interop.RemoteObjRef, IPaper, IPaper2, IClone, IPersist, IPersistStream, ISupportErrorInfo, Externalizable, Serializable

public class Paper
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, IPaper, IPaper2, IClone, IPersistStream, ISupportErrorInfo, Externalizable

The default printer page settings.

Remarks

The Paper object is a key object required by the Printer object. The Paper object is responsible for maintaining properties related to the paper and printer used with the Printer object. In the ArcMap application, the Paper object is accessed throught the Printer Setup section of the Page and Print Setup dialog.

When working with an ArcGIS application like ArcMap, a Paper object is automatically created based on the default printer for the system. To use another printer on the system, you must define a new Paper object and set it to the printer or plotter through the PrinterName property. The Paper object can then be associated with the Printer object through the IPrinter::Paper property.

The Paper object is basically a wrapper for the Microsoft GDI DevMode and DevNames parameters. The Windows GDI documentation on the Microsoft Developer Network (MSDN) library provides further details about these structures.

The DevNames structure contains strings that identify the driver, device, and output port names for a printer. The DevMode data structure contains information about the device initialization and environment of a printer.

The Attach method is used by a Printer object when the IPrinter::Paper property is set. ArcObjects developers will typically not need to use this method.

QueryPaperSize is a useful method for interrogating the dimensions of the Printer's currently selected Form size.


Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

See Also:
Serialized Form

Constructor Summary
Paper()
          Constructs a Paper using ArcGIS Engine.
Paper(Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
Paper thePaper = (Paper) obj;
 
Method Summary
 void assign(IClone src)
          Assigns the properties of src to the receiver.
 void attach(int hDevMode, int hDevNames)
          Attach object to specified DEVMODE and DEVNAMES structures.
 boolean equals(Object o)
          Compare this object with another
 IClone esri_clone()
          Clones the receiver and assigns the result to *clone.
 void getClassID(GUID[] pClassID)
          getClassID
static String getClsid()
          getClsid.
 short getFormID()
          The printer page form.
 String getFormName()
          The Form Name.
 IEnumNamedID getForms()
          Enumerate forms supported by the printer.
 short getOrientation()
          The printer page orientation (1 = portrait.
 IEnvelope getPrintableBounds()
          The area of the printer page that can be printed on.
 int getPrinterInfo(int[] hDevMode)
          Display the Print Setup Dialog.
 String getPrinterName()
          The Printer Name.
 short getResolution()
          The print resolution.
 void getSizeMax(_ULARGE_INTEGER[] pcbSize)
          getSizeMax
 short getTrayID()
          The printer tray.
 IEnumNamedID getTrays()
          Enumerate trays supported by the printer.
 int getUnits()
          The units used by the other properties.
 int hashCode()
          the hashcode for this object
 void interfaceSupportsErrorInfo(GUID riid)
          interfaceSupportsErrorInfo
 void isDirty()
          isDirty
 boolean isEqual(IClone other)
          Indicates if the receiver and other have the same properties.
 boolean isIdentical(IClone other)
          Indicates if the receiver and other are the same object.
 void load(IStream pstm)
          load
 void queryPaperSize(double[] width, double[] height)
          Returns the size of the printer paper.
 void readExternal(ObjectInput in)
           
 void save(IStream pstm, int fClearDirty)
          save
 void setFormID(short formID)
          The printer page form.
 void setOrientation(short orientation)
          The printer page orientation (1 = portrait.
 void setPrinterName(String printerName)
          The Printer Name.
 void setTrayID(short trayID)
          The printer tray.
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.esri.arcgis.interop.RemoteObjRef
getJintegraDispatch, release
 

Constructor Detail

Paper

public Paper()
      throws IOException,
             UnknownHostException
Constructs a Paper using ArcGIS Engine.

Throws:
IOException - if there are interop problems
UnknownHostException - if there are interop problems

Paper

public Paper(Object obj)
      throws IOException
Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
Paper thePaper = (Paper) obj;

Construct a Paper using a reference to such an object returned from ArcGIS Engine or Server. This is semantically equivalent to casting obj to Paper.

Parameters:
obj - an object returned from ArcGIS Engine or Server
Throws:
IOException - if there are interop problems
Method Detail

getClsid

public static String getClsid()
getClsid.


equals

public boolean equals(Object o)
Compare this object with another

Overrides:
equals in class Object

hashCode

public int hashCode()
the hashcode for this object

Overrides:
hashCode in class Object

getUnits

public int getUnits()
             throws IOException,
                    AutomationException
The units used by the other properties.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getUnits in interface IPaper
Returns:
A com.esri.arcgis.system.esriUnits constant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getPrintableBounds

public IEnvelope getPrintableBounds()
                             throws IOException,
                                    AutomationException
The area of the printer page that can be printed on.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getPrintableBounds in interface IPaper
Returns:
A reference to a com.esri.arcgis.geometry.IEnvelope
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getOrientation

public short getOrientation()
                     throws IOException,
                            AutomationException
The printer page orientation (1 = portrait. 2 = landscape).

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getOrientation in interface IPaper
Returns:
The orientation
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setOrientation

public void setOrientation(short orientation)
                    throws IOException,
                           AutomationException
The printer page orientation (1 = portrait. 2 = landscape).

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
setOrientation in interface IPaper
Parameters:
orientation - The orientation (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getForms

public IEnumNamedID getForms()
                      throws IOException,
                             AutomationException
Enumerate forms supported by the printer.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getForms in interface IPaper
Returns:
A reference to a com.esri.arcgis.system.IEnumNamedID
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getFormName

public String getFormName()
                   throws IOException,
                          AutomationException
The Form Name.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getFormName in interface IPaper
Returns:
The formName
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getFormID

public short getFormID()
                throws IOException,
                       AutomationException
The printer page form. Use Win32 DMPAPER_xxx constants.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getFormID in interface IPaper
Returns:
The formID
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setFormID

public void setFormID(short formID)
               throws IOException,
                      AutomationException
The printer page form. Use Win32 DMPAPER_xxx constants.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
setFormID in interface IPaper
Parameters:
formID - The formID (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getTrays

public IEnumNamedID getTrays()
                      throws IOException,
                             AutomationException
Enumerate trays supported by the printer.

Remarks

Use the Trays enumerator to get a list valid tray ids for the currently selected printer. The returned tray ids can be used in the IPaper interface's TrayID property.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getTrays in interface IPaper
Returns:
A reference to a com.esri.arcgis.system.IEnumNamedID
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getTrayID

public short getTrayID()
                throws IOException,
                       AutomationException
The printer tray. Use Win32 DMBIN_xxx constants.

Remarks

Use the TrayID property to control which paper tray will be used for feeding printer paper. Because the value of the TrayID property will be used by the printer driver directly, it must contain a valid value at print time. The Win32 API documentation makes reference to these values as the DMBIN contstants. In practice, no printer driver supports the full range of DMBIN paper tray values; usually only a small subset is valid. Thus, it is not possible to assign an arbitrary DMBIN constant to the TrayID property. You must always first enumerate for valid tray ids before assigning. Use the IPaper interface's Trays enumerator to get a list valid tray ids for the currently selected printer.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getTrayID in interface IPaper
Returns:
The trayID
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setTrayID

public void setTrayID(short trayID)
               throws IOException,
                      AutomationException
The printer tray. Use Win32 DMBIN_xxx constants.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
setTrayID in interface IPaper
Parameters:
trayID - The trayID (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getPrinterName

public String getPrinterName()
                      throws IOException,
                             AutomationException
The Printer Name.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getPrinterName in interface IPaper
Returns:
The printerName
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setPrinterName

public void setPrinterName(String printerName)
                    throws IOException,
                           AutomationException
The Printer Name.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
setPrinterName in interface IPaper
Parameters:
printerName - The printerName (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

attach

public void attach(int hDevMode,
                   int hDevNames)
            throws IOException,
                   AutomationException
Attach object to specified DEVMODE and DEVNAMES structures. This must be called before using other properties and methods.

Remarks

This method is used by the Printer object, called when the IPrinter::Paper property is set. Most ArcObjects developers will not need to use this method unless they are doing a custom implementation of IPrinter.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
attach in interface IPaper
Parameters:
hDevMode - The hDevMode (A COM typedef) (in)
hDevNames - The hDevNames (A COM typedef) (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

queryPaperSize

public void queryPaperSize(double[] width,
                           double[] height)
                    throws IOException,
                           AutomationException
Returns the size of the printer paper. Units property specifies measurement units.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
queryPaperSize in interface IPaper
Parameters:
width - The width (out: use single element array)
height - The height (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getPrinterInfo

public int getPrinterInfo(int[] hDevMode)
                   throws IOException,
                          AutomationException
Display the Print Setup Dialog.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getPrinterInfo in interface IPaper
Parameters:
hDevMode - The hDevMode (A COM typedef) (out: use single element array)
Returns:
The hDevNames (A COM typedef)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getResolution

public short getResolution()
                    throws IOException,
                           AutomationException
The print resolution.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getResolution in interface IPaper2
Returns:
The resolution
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

esri_clone

public IClone esri_clone()
                  throws IOException,
                         AutomationException
Clones the receiver and assigns the result to *clone.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
esri_clone in interface IClone
Returns:
A reference to a com.esri.arcgis.system.IClone
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

assign

public void assign(IClone src)
            throws IOException,
                   AutomationException
Assigns the properties of src to the receiver.

Description

Use Assign method to assign the properties of source object to receiver object. Both objects need to have the same CLSIDs. Both source and receiver objects need to be instantiated.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
assign in interface IClone
Parameters:
src - A reference to a com.esri.arcgis.system.IClone (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isEqual

public boolean isEqual(IClone other)
                throws IOException,
                       AutomationException
Indicates if the receiver and other have the same properties.

Description

IsEqual returns True if the receiver and the source have the same properties. Note, this does not imply that the receiver and the source reference the same object.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
isEqual in interface IClone
Parameters:
other - A reference to a com.esri.arcgis.system.IClone (in)
Returns:
The equal
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isIdentical

public boolean isIdentical(IClone other)
                    throws IOException,
                           AutomationException
Indicates if the receiver and other are the same object.

Description

IsIdentical returns true if the receiver and the source reference the same object.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
isIdentical in interface IClone
Parameters:
other - A reference to a com.esri.arcgis.system.IClone (in)
Returns:
The identical
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isDirty

public void isDirty()
             throws IOException,
                    AutomationException
isDirty

Description

IPersistStream is a Microsoft interface. Please refer to MSDN for information about this interface.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
isDirty in interface IPersistStream
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

load

public void load(IStream pstm)
          throws IOException,
                 AutomationException
load

Description

IPersistStream is a Microsoft interface. Please refer to MSDN for information about this interface.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
load in interface IPersistStream
Parameters:
pstm - A reference to a com.esri.arcgis.system.IStream (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

save

public void save(IStream pstm,
                 int fClearDirty)
          throws IOException,
                 AutomationException
save

Description

IPersistStream is a Microsoft interface. Please refer to MSDN for information about this interface.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
save in interface IPersistStream
Parameters:
pstm - A reference to a com.esri.arcgis.system.IStream (in)
fClearDirty - The fClearDirty (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSizeMax

public void getSizeMax(_ULARGE_INTEGER[] pcbSize)
                throws IOException,
                       AutomationException
getSizeMax

Description

IPersistStream is a Microsoft interface. Please refer to MSDN for information about this interface.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getSizeMax in interface IPersistStream
Parameters:
pcbSize - A Structure: com.esri.arcgis.system._ULARGE_INTEGER (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getClassID

public void getClassID(GUID[] pClassID)
                throws IOException,
                       AutomationException
getClassID

Description

IPersist is a Microsoft interface. Please refer to MSDN for information about this interface.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getClassID in interface IPersist
Parameters:
pClassID - A Structure: com.esri.arcgis.support.ms.stdole.GUID (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

interfaceSupportsErrorInfo

public void interfaceSupportsErrorInfo(GUID riid)
                                throws IOException,
                                       AutomationException
interfaceSupportsErrorInfo

Description

Indicates whether the interface supports IErrorInfo.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
interfaceSupportsErrorInfo in interface ISupportErrorInfo
Parameters:
riid - A Structure: com.esri.arcgis.support.ms.stdole.GUID (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Throws:
IOException

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Throws:
IOException
ClassNotFoundException