JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.page.adobe.postscript
Class JCEPSPrinter

java.lang.Object
  |
  +--com.klg.jclass.page.JCPrinter
        |
        +--com.klg.jclass.page.adobe.postscript.JCEPSPrinter

public class JCEPSPrinter
extends JCPrinter

Implements the PrinterDriver interface.


Field Summary
 
Fields inherited from class com.klg.jclass.page.JCPrinter
bookmarkTree, bookmarkTreeVisible, collate, compressed, endPage, graphics, imageNumber, isDocOpen, numCopies, orientation, os, pageCount, printListeners, reverseOrder, startPage
 
Constructor Summary
JCEPSPrinter(OutputStream os)
          Creates an EPS printer given an OutputStream.
JCEPSPrinter(OutputStream os, com.klg.jclass.page.FontParser parser, String jarLocation, String fileExtension, String fontMapFileName)
          Constructor.
 
Method Summary
 void beginPage(Rectangle2D pageSize, int pageNumber)
          Defines beginPage() to be a no-op for EPS.
 void closeDocument(Rectangle2D pageSize)
          Completes the document (removes the dictionary and draw).
 void endPage(Rectangle2D pageSize)
          Defines endPage() to be a no-op for EPS.
 Graphics getGraphics()
          Gets a Graphics that draws to this printer.
 boolean isImageScalable()
          Returns true since EPS can scale images itself.
 void openDocument(Rectangle2D pageSize)
          Initializes the document (EPS document headers, etc.)
 void setup()
          Creates default styles, any other one-time initialization.
 
Methods inherited from class com.klg.jclass.page.JCPrinter
addPrintListener, getCollate, getFontFamilies, getNumCopies, getOrientation, getOutputPageEnd, getOutputPageStart, getOutputStream, getReverseOrder, isBookmarkTreeVisible, isCompressed, isDocumentOpen, isLandscape, output, output, output, output, removePrintListener, setCollate, setCompressed, setNumCopies, setOrientation, setOutputPageEnd, setOutputPageStart, setOutputStream, setReverseOrder, supportsHyperlinks
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JCEPSPrinter

public JCEPSPrinter(OutputStream os)
Creates an EPS printer given an OutputStream.

Parameters:
os - an OutputStream to write the PostScript code to

JCEPSPrinter

public JCEPSPrinter(OutputStream os,
                    com.klg.jclass.page.FontParser parser,
                    String jarLocation,
                    String fileExtension,
                    String fontMapFileName)
Constructor. Allows detailed specification of font creation. The constructor which takes one argument is akin to calling this constructor with these parameters:
		JCPrinter p = new JCEPSPrinter(
			someOutputStream,						// the output stream
			new com.klg.jclass.page.adobe.postscript.AFMParser(), // the parser
			"/com/klg/jclass/page/adobe/fonts.jar", // jar location
			".afm",									// file extension
			"com.klg.jclass.page.adobe.JCAdobeFontMap");
 

Parameters:
os - the OutputStream to which formatted output should be sent
parser - the FontParser which creates fonts from afm files
jarLocation - the location of the jar containing afm files relative to the class loader including the name of the jar file
fileExtension - the parser will turn all files contained in "jarLocation" which end with this extension into fonts
fontMapFileName - the user fontmap file; a file containing mappings between font names and their aliases
Method Detail

setup

public void setup()
Creates default styles, any other one-time initialization. Builds font families from available fonts.

Specified by:
setup in class JCPrinter

isImageScalable

public boolean isImageScalable()
Returns true since EPS can scale images itself.

Specified by:
isImageScalable in class JCPrinter
Returns:
true since EPS can scale images itself

openDocument

public void openDocument(Rectangle2D pageSize)
Initializes the document (EPS document headers, etc.)

Overrides:
openDocument in class JCPrinter
Parameters:
pageSize - the size of the default/first page of the document

closeDocument

public void closeDocument(Rectangle2D pageSize)
Completes the document (removes the dictionary and draw).

Overrides:
closeDocument in class JCPrinter
Parameters:
pageSize - the size of the default/last page of the document

beginPage

public void beginPage(Rectangle2D pageSize,
                      int pageNumber)
Defines beginPage() to be a no-op for EPS.

Overrides:
beginPage in class JCPrinter
Parameters:
pageSize - the dimensions of the new page
pageNumber -

endPage

public void endPage(Rectangle2D pageSize)
Defines endPage() to be a no-op for EPS.

Overrides:
endPage in class JCPrinter
Parameters:
pageSize - the dimensions of the current page

getGraphics

public Graphics getGraphics()
Gets a Graphics that draws to this printer.

Overrides:
getGraphics in class JCPrinter
Returns:
a Graphics object instantiated for this printer

Copyright © 2004 Quest Software Inc..
All rights reserved.