com.esri.arcgis.output
Class EmfPrinter

java.lang.Object
  extended by com.esri.arcgis.output.EmfPrinter
All Implemented Interfaces:
com.esri.arcgis.interop.RemoteObjRef, IEmfPrinter, IOutputCleanup, IPrinter, IPrinterMPage, ITrackCancelSetup, IClone, IPersist, IPersistStream, ISupportErrorInfo, Externalizable, Serializable

public class EmfPrinter
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, IEmfPrinter, IPrinter, IPrinterMPage, IPersistStream, IClone, ISupportErrorInfo, IOutputCleanup, ITrackCancelSetup, Externalizable

Class used to print maps with the EMF (Windows Enhanced Metafile) Printer Driver.

Product Availability

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

Supported Platforms

Windows

See Also:
Serialized Form

Constructor Summary
EmfPrinter()
          Constructs a EmfPrinter using ArcGIS Engine.
EmfPrinter(Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
EmfPrinter theEmfPrinter = (EmfPrinter) obj;
 
Method Summary
 void assign(IClone src)
          Assigns the properties of src to the receiver.
 void cleanup()
          Cleanup should clean all temporary files, free used memory, etc...
 boolean doesDriverSupportPrinter(String printerName)
          Indicates if the Printer Name passed into function is supported by the IPrinter Driver.
 void endMapDocument()
          End map document.
 void endPage()
          Finalize current page output.
 boolean equals(Object o)
          Compare this object with another
 IClone esri_clone()
          Clones the receiver and assigns the result to *clone.
 void finishPrinting()
          Finish up Printing.
 void getClassID(GUID[] pClassID)
          getClassID
static String getClsid()
          getClsid.
 String getDriverName()
          The name of Windows Printer Driver.
 String getFileExtension()
          File Extension associated with the Printer Driver.
 String getFilter()
          Filter used in CFileDialog.
 String getName()
          Name of the IPrinter Driver.
 IPaper getPaper()
          The IPaper interface.
 IEnvelope getPrintableBounds()
          The area of the printer page that can be printed on.
 String getPrintToFile()
          The name of file if saving to Disk.
 short getResolution()
          The Printer Driver Resolution.
 void getSizeMax(_ULARGE_INTEGER[] pcbSize)
          getSizeMax
 String getSpoolFileName()
          The Spool File Name which shows up in the Print Manager.
 int getUnits()
          The units for PaperSize and PrintableBounds.
 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 Page Size for Printer.
 void readExternal(ObjectInput in)
           
 void save(IStream pstm, int fClearDirty)
          save
 void setPaperByRef(IPaper paper)
          The IPaper interface.
 void setPrintToFile(String fileName)
          The name of file if saving to Disk.
 void setResolution(short res)
          The Printer Driver Resolution.
 void setSpoolFileName(String spoolFileName)
          The Spool File Name which shows up in the Print Manager.
 void setStepProgressor(IStepProgressor rhs1)
          Updates a Progress Bar is set.
 void setTrackCancel(ITrackCancel rhs1)
          Reacts to a Cancel.
 void startMapDocument()
          Begin map document.
 int startPage(IEnvelope pixelBounds, int hDcPrinter)
          Start new page output.
 int startPrinting(IEnvelope pixelBounds, int hDcPrinter)
          Initialize Printing.
 boolean verifyDriverSettings()
          Indicates if the Printer Driver should validate Printer Driver's local settings.
 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

EmfPrinter

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

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

EmfPrinter

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

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

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

getName

public String getName()
               throws IOException,
                      AutomationException
Name of the IPrinter Driver.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
getName in interface IPrinter
Returns:
The name
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getFilter

public String getFilter()
                 throws IOException,
                        AutomationException
Filter used in CFileDialog.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
getFilter in interface IPrinter
Returns:
The filter
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getFileExtension

public String getFileExtension()
                        throws IOException,
                               AutomationException
File Extension associated with the Printer Driver.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
getFileExtension in interface IPrinter
Returns:
The name
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setPrintToFile

public void setPrintToFile(String fileName)
                    throws IOException,
                           AutomationException
The name of file if saving to Disk.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

getPrintToFile

public String getPrintToFile()
                      throws IOException,
                             AutomationException
The name of file if saving to Disk.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
getPrintToFile in interface IPrinter
Returns:
The fileName
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getDriverName

public String getDriverName()
                     throws IOException,
                            AutomationException
The name of Windows Printer Driver.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
getDriverName in interface IPrinter
Returns:
The driverName
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setSpoolFileName

public void setSpoolFileName(String spoolFileName)
                      throws IOException,
                             AutomationException
The Spool File Name which shows up in the Print Manager.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

getSpoolFileName

public String getSpoolFileName()
                        throws IOException,
                               AutomationException
The Spool File Name which shows up in the Print Manager.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
getSpoolFileName in interface IPrinter
Returns:
The spoolFileName
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setResolution

public void setResolution(short res)
                   throws IOException,
                          AutomationException
The Printer Driver Resolution.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

getResolution

public short getResolution()
                    throws IOException,
                           AutomationException
The Printer Driver Resolution.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

setStepProgressor

public void setStepProgressor(IStepProgressor rhs1)
                       throws IOException,
                              AutomationException
Updates a Progress Bar is set.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

setPaperByRef

public void setPaperByRef(IPaper paper)
                   throws IOException,
                          AutomationException
The IPaper interface.

Product Availability

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

Specified by:
setPaperByRef in interface IPrinter
Parameters:
paper - A reference to a com.esri.arcgis.output.IPaper (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getPaper

public IPaper getPaper()
                throws IOException,
                       AutomationException
The IPaper interface.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
getPaper in interface IPrinter
Returns:
A reference to a com.esri.arcgis.output.IPaper
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 Page Size for Printer.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
queryPaperSize in interface IPrinter
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.

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

getUnits

public int getUnits()
             throws IOException,
                    AutomationException
The units for PaperSize and PrintableBounds.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

verifyDriverSettings

public boolean verifyDriverSettings()
                             throws IOException,
                                    AutomationException
Indicates if the Printer Driver should validate Printer Driver's local settings.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
verifyDriverSettings in interface IPrinter
Returns:
The ok
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

doesDriverSupportPrinter

public boolean doesDriverSupportPrinter(String printerName)
                                 throws IOException,
                                        AutomationException
Indicates if the Printer Name passed into function is supported by the IPrinter Driver.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

startPrinting

public int startPrinting(IEnvelope pixelBounds,
                         int hDcPrinter)
                  throws IOException,
                         AutomationException
Initialize Printing.

Remarks

The StartPrinting method returns a long that represents the hDC (Windows GDI Device Context handle) of the printer object. After this method is called, the printer object is ready to receive GDI draw instructions directed to its hDC.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
startPrinting in interface IPrinter
Parameters:
pixelBounds - A reference to a com.esri.arcgis.geometry.IEnvelope (in)
hDcPrinter - The hDcPrinter (A COM typedef) (in)
Returns:
The hDcRet (A COM typedef)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

finishPrinting

public void finishPrinting()
                    throws IOException,
                           AutomationException
Finish up Printing.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

startMapDocument

public void startMapDocument()
                      throws IOException,
                             AutomationException
Begin map document. Document consists of one or more pages.

Product Availability

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

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

startPage

public int startPage(IEnvelope pixelBounds,
                     int hDcPrinter)
              throws IOException,
                     AutomationException
Start new page output.

Product Availability

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

Specified by:
startPage in interface IPrinterMPage
Parameters:
pixelBounds - A reference to a com.esri.arcgis.geometry.IEnvelope (in)
hDcPrinter - The hDcPrinter (A COM typedef) (in)
Returns:
The hDcRet (A COM typedef)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

endPage

public void endPage()
             throws IOException,
                    AutomationException
Finalize current page output.

Product Availability

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

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

endMapDocument

public void endMapDocument()
                    throws IOException,
                           AutomationException
End map document.

Product Availability

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

Specified by:
endMapDocument in interface IPrinterMPage
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.

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.

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.

cleanup

public void cleanup()
             throws IOException,
                    AutomationException
Cleanup should clean all temporary files, free used memory, etc...

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

setTrackCancel

public void setTrackCancel(ITrackCancel rhs1)
                    throws IOException,
                           AutomationException
Reacts to a Cancel.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
setTrackCancel in interface ITrackCancelSetup
Parameters:
rhs1 - A reference to a com.esri.arcgis.system.ITrackCancel (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