com.esri.arcgis.output
Class EmfPrinter

java.lang.Object
  extended bycom.esri.arcgis.output.EmfPrinter
All Implemented Interfaces:
IClone, IEmfPrinter, IOutputCleanup, IPersist, IPersistStream, IPrinter, ISupportErrorInfo, ITrackCancelSetup, java.io.Serializable

public class EmfPrinter
extends java.lang.Object
implements IEmfPrinter, IPrinter, IPersistStream, IClone, ISupportErrorInfo, IOutputCleanup, ITrackCancelSetup

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(java.lang.Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
 
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(java.lang.String printerName)
          Indicates if the Printer Name passed into function is supported by the IPrinter Driver.
 boolean equals(java.lang.Object o)
          Compare this object with another
 IClone esri_clone()
          Clones the receiver and assigns the result to *clone.
 void finishPrinting()
          Finish up Printing.
 IClone getAsIClone()
          Deprecated. No replacement. The object reference can be directly used where the implemented interface is needed.
 IEmfPrinter getAsIEmfPrinter()
          Deprecated. No replacement. The object reference can be directly used where the implemented interface is needed.
 IOutputCleanup getAsIOutputCleanup()
          Deprecated. No replacement. The object reference can be directly used where the implemented interface is needed.
 IPersistStream getAsIPersistStream()
          Deprecated. No replacement. The object reference can be directly used where the implemented interface is needed.
 IPrinter getAsIPrinter()
          Deprecated. No replacement. The object reference can be directly used where the implemented interface is needed.
 ISupportErrorInfo getAsISupportErrorInfo()
          Deprecated. No replacement. The object reference can be directly used where the implemented interface is needed.
 ITrackCancelSetup getAsITrackCancelSetup()
          Deprecated. No replacement. The object reference can be directly used where the implemented interface is needed.
 void getClassID(GUID[] pClassID)
          Supported Platforms
static java.lang.String getClsid()
           
 java.lang.String getDriverName()
          The name of Windows Printer Driver.
 java.lang.String getFileExtension()
          File Extension associated with the Printer Driver.
 java.lang.String getFilter()
          Filter used in CFileDialog.
 java.lang.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.
 java.lang.String getPrintToFile()
          The name of file if saving to Disk.
 short getResolution()
          The Printer Driver Resolution.
 void getSizeMax(_ULARGE_INTEGER[] pcbSize)
          Supported Platforms
 java.lang.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)
          Supported Platforms
 void isDirty()
          Supported Platforms
 boolean isEqual(IClone other)
          Returns TRUE when the receiver and other have the same properties.
 boolean isIdentical(IClone other)
          Returns TRUE when the receiver and other are the same object.
 void load(IStream pstm)
          Supported Platforms
 void queryPaperSize(double[] width, double[] height)
          Returns Page Size for Printer.
 void save(IStream pstm, int fClearDirty)
          Supported Platforms
 void setPaperByRef(IPaper paper)
          The IPaper interface.
 void setPrintToFile(java.lang.String fileName)
          The name of file if saving to Disk.
 void setResolution(short res)
          The Printer Driver Resolution.
 void setSpoolFileName(java.lang.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.
 int startPrinting(IEnvelope pixelBounds, int hDcPrinter)
          Initialize Printing.
 boolean verifyDriverSettings()
          Indicates if the Printer Driver should validate Printer Driver's local settings.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EmfPrinter

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

Throws:
java.io.IOException - if there are interop problems
java.net.UnknownHostException - if there are interop problems

EmfPrinter

public EmfPrinter(java.lang.Object obj)
           throws java.io.IOException
Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.

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.
EmfPrinter theEmfPrinter = (EmfPrinter) obj;

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

getClsid

public static java.lang.String getClsid()

getAsIEmfPrinter

public IEmfPrinter getAsIEmfPrinter()
Deprecated. No replacement. The object reference can be directly used where the implemented interface is needed.


getAsIPrinter

public IPrinter getAsIPrinter()
Deprecated. No replacement. The object reference can be directly used where the implemented interface is needed.


getAsIPersistStream

public IPersistStream getAsIPersistStream()
Deprecated. No replacement. The object reference can be directly used where the implemented interface is needed.


getAsIClone

public IClone getAsIClone()
Deprecated. No replacement. The object reference can be directly used where the implemented interface is needed.


getAsISupportErrorInfo

public ISupportErrorInfo getAsISupportErrorInfo()
Deprecated. No replacement. The object reference can be directly used where the implemented interface is needed.


getAsIOutputCleanup

public IOutputCleanup getAsIOutputCleanup()
Deprecated. No replacement. The object reference can be directly used where the implemented interface is needed.


getAsITrackCancelSetup

public ITrackCancelSetup getAsITrackCancelSetup()
Deprecated. No replacement. The object reference can be directly used where the implemented interface is needed.


equals

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


hashCode

public int hashCode()
the hashcode for this object


getName

public java.lang.String getName()
                         throws java.io.IOException,
                                AutomationException
Description copied from interface: IPrinter
Name of the IPrinter Driver.

Supported Platforms

Windows, Solaris, Linux

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

getFilter

public java.lang.String getFilter()
                           throws java.io.IOException,
                                  AutomationException
Description copied from interface: IPrinter
Filter used in CFileDialog.

Supported Platforms

Windows, Solaris, Linux

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

getFileExtension

public java.lang.String getFileExtension()
                                  throws java.io.IOException,
                                         AutomationException
Description copied from interface: IPrinter
File Extension associated with the Printer Driver.

Supported Platforms

Windows, Solaris, Linux

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

setPrintToFile

public void setPrintToFile(java.lang.String fileName)
                    throws java.io.IOException,
                           AutomationException
Description copied from interface: IPrinter
The name of file if saving to Disk.

Supported Platforms

Windows, Solaris, Linux

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

getPrintToFile

public java.lang.String getPrintToFile()
                                throws java.io.IOException,
                                       AutomationException
Description copied from interface: IPrinter
The name of file if saving to Disk.

Supported Platforms

Windows, Solaris, Linux

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

getDriverName

public java.lang.String getDriverName()
                               throws java.io.IOException,
                                      AutomationException
Description copied from interface: IPrinter
The name of Windows Printer Driver.

Supported Platforms

Windows, Solaris, Linux

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

setSpoolFileName

public void setSpoolFileName(java.lang.String spoolFileName)
                      throws java.io.IOException,
                             AutomationException
Description copied from interface: IPrinter
The Spool File Name which shows up in the Print Manager.

Supported Platforms

Windows, Solaris, Linux

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

getSpoolFileName

public java.lang.String getSpoolFileName()
                                  throws java.io.IOException,
                                         AutomationException
Description copied from interface: IPrinter
The Spool File Name which shows up in the Print Manager.

Supported Platforms

Windows, Solaris, Linux

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

setResolution

public void setResolution(short res)
                   throws java.io.IOException,
                          AutomationException
Description copied from interface: IPrinter
The Printer Driver Resolution.

Supported Platforms

Windows, Solaris, Linux

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

getResolution

public short getResolution()
                    throws java.io.IOException,
                           AutomationException
Description copied from interface: IPrinter
The Printer Driver Resolution.

Supported Platforms

Windows, Solaris, Linux

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

setStepProgressor

public void setStepProgressor(IStepProgressor rhs1)
                       throws java.io.IOException,
                              AutomationException
Description copied from interface: IPrinter
Updates a Progress Bar is set.

Supported Platforms

Windows, Solaris, Linux

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

setPaperByRef

public void setPaperByRef(IPaper paper)
                   throws java.io.IOException,
                          AutomationException
Description copied from interface: IPrinter
The IPaper interface.

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

getPaper

public IPaper getPaper()
                throws java.io.IOException,
                       AutomationException
Description copied from interface: IPrinter
The IPaper interface.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getPaper in interface IPrinter
Returns:
A reference to a com.esri.arcgis.output.IPaper
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

queryPaperSize

public void queryPaperSize(double[] width,
                           double[] height)
                    throws java.io.IOException,
                           AutomationException
Description copied from interface: IPrinter
Returns Page Size for Printer.

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:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getPrintableBounds

public IEnvelope getPrintableBounds()
                             throws java.io.IOException,
                                    AutomationException
Description copied from interface: IPrinter
The area of the printer page that can be printed on.

Supported Platforms

Windows, Solaris, Linux

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

getUnits

public int getUnits()
             throws java.io.IOException,
                    AutomationException
Description copied from interface: IPrinter
The units for PaperSize and PrintableBounds.

Supported Platforms

Windows, Solaris, Linux

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

verifyDriverSettings

public boolean verifyDriverSettings()
                             throws java.io.IOException,
                                    AutomationException
Description copied from interface: IPrinter
Indicates if the Printer Driver should validate Printer Driver's local settings.

Supported Platforms

Windows, Solaris, Linux

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

doesDriverSupportPrinter

public boolean doesDriverSupportPrinter(java.lang.String printerName)
                                 throws java.io.IOException,
                                        AutomationException
Description copied from interface: IPrinter
Indicates if the Printer Name passed into function is supported by the IPrinter Driver.

Supported Platforms

Windows, Solaris, Linux

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

startPrinting

public int startPrinting(IEnvelope pixelBounds,
                         int hDcPrinter)
                  throws java.io.IOException,
                         AutomationException
Description copied from interface: IPrinter
Initialize Printing.

Supported Platforms

Windows, Solaris, Linux

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.

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:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

finishPrinting

public void finishPrinting()
                    throws java.io.IOException,
                           AutomationException
Description copied from interface: IPrinter
Finish up Printing.

Supported Platforms

Windows, Solaris, Linux

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

isDirty

public void isDirty()
             throws java.io.IOException,
                    AutomationException
Description copied from interface: IPersistStream

Supported Platforms

Windows, Solaris, Linux

Description

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

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

load

public void load(IStream pstm)
          throws java.io.IOException,
                 AutomationException
Description copied from interface: IPersistStream

Supported Platforms

Windows, Solaris, Linux

Description

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

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

save

public void save(IStream pstm,
                 int fClearDirty)
          throws java.io.IOException,
                 AutomationException
Description copied from interface: IPersistStream

Supported Platforms

Windows, Solaris, Linux

Description

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

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

getSizeMax

public void getSizeMax(_ULARGE_INTEGER[] pcbSize)
                throws java.io.IOException,
                       AutomationException
Description copied from interface: IPersistStream

Supported Platforms

Windows, Solaris, Linux

Description

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

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

getClassID

public void getClassID(GUID[] pClassID)
                throws java.io.IOException,
                       AutomationException
Description copied from interface: IPersist

Supported Platforms

Windows, Solaris, Linux

Description

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

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

esri_clone

public IClone esri_clone()
                  throws java.io.IOException,
                         AutomationException
Description copied from interface: IClone
Clones the receiver and assigns the result to *clone.

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

assign

public void assign(IClone src)
            throws java.io.IOException,
                   AutomationException
Description copied from interface: IClone
Assigns the properties of src to the receiver.

Supported Platforms

Windows, Solaris, Linux

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.

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

isEqual

public boolean isEqual(IClone other)
                throws java.io.IOException,
                       AutomationException
Description copied from interface: IClone
Returns TRUE when the receiver and other have the same properties.

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

isIdentical

public boolean isIdentical(IClone other)
                    throws java.io.IOException,
                           AutomationException
Description copied from interface: IClone
Returns TRUE when the receiver and other are the same object.

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

interfaceSupportsErrorInfo

public void interfaceSupportsErrorInfo(GUID riid)
                                throws java.io.IOException,
                                       AutomationException
Description copied from interface: ISupportErrorInfo

Supported Platforms

Windows, Solaris, Linux

Description

Indicates whether the interface supports IErrorInfo.

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

cleanup

public void cleanup()
             throws java.io.IOException,
                    AutomationException
Description copied from interface: IOutputCleanup
Cleanup should clean all temporary files, free used memory, etc...

Supported Platforms

Windows, Solaris, Linux

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

setTrackCancel

public void setTrackCancel(ITrackCancel rhs1)
                    throws java.io.IOException,
                           AutomationException
Description copied from interface: ITrackCancelSetup
Reacts to a Cancel.

Supported Platforms

Windows, Solaris, Linux

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