|
JClass DesktopViews 6.3.0 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.klg.jclass.page.JCPrinter | +--com.klg.jclass.page.adobe.postscript.JCPostScriptPrinter
Implements the PrinterDriver
interface.
Field Summary | |
protected int |
characterEncoding
|
static int |
ENCODING_ISO_LATIN_1
|
static int |
ENCODING_ISO_LATIN_1_EURO
|
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 | |
JCPostScriptPrinter(OutputStream os)
Creates a PostScript printer given an OutputStream . |
|
JCPostScriptPrinter(OutputStream os,
com.klg.jclass.page.FontParser parser,
String jarLocation,
String fileExtension,
String fontMapFileName)
Constructor. |
Method Summary | |
void |
beginPage(Rectangle2D pageSize,
int pageNumber)
Outputs the PostScript code necessary to start a page. |
void |
closeDocument(Rectangle2D pageSize)
Completes the document (output the DSC trailer). |
void |
endPage(Rectangle2D pageSize)
End the page; outputs the appropriate DSC comments, etc. |
int |
getCharacterEncoding()
Gets the character encoding vector being used for PostScript output. |
Graphics |
getGraphics()
Gets a Graphics that draws to this printer. |
boolean |
isImageScalable()
Returns true since PostScript can scale images itself. |
void |
openDocument(Rectangle2D pageSize)
Initializes the document (PostScript document headers, etc.) |
void |
setCharacterEncoding(int encoding)
Sets the character encoding vector to use for PostScript output. |
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 |
Field Detail |
public static final int ENCODING_ISO_LATIN_1
public static final int ENCODING_ISO_LATIN_1_EURO
protected int characterEncoding
Constructor Detail |
public JCPostScriptPrinter(OutputStream os)
OutputStream
.
Note: For large documents and for optimal performance, wrap
the output stream in a BufferedOutputStream
. For example:
BufferedOutputStream bos = new BufferedOutputStream(os, 2048); JCPrinter printer = new JCPostScriptPrinter(bos);
os
- an OutputStream
to write the PostScript code topublic JCPostScriptPrinter(OutputStream os, com.klg.jclass.page.FontParser parser, String jarLocation, String fileExtension, String fontMapFileName)
JCPrinter p = new JCPostScriptPrinter( 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");
Note: For large documents and for optimal performance, wrap
the output stream in a BufferedOutputStream
. For example:
BufferedOutputStream bos = new BufferedOutputStream(os, 2048); JCPrinter printer = new JCPostScriptPrinter(bos, ...);
os
- the OutputStream
to which formatted output should be sentparser
- the FontParser
which creates fonts from afm filesjarLocation
- the location of the jar containing afm files relative
to the class loader including the name of the jar filefileExtension
- the parser will turn files contained in "jarLocation"
ending with this extension into fontsfontMapFileName
- the user fontmap file; a file containing mappings
between font names and their aliasesMethod Detail |
public void setup()
setup
in class JCPrinter
public boolean isImageScalable()
true
since PostScript can scale images itself.
isImageScalable
in class JCPrinter
true
since PostScript can scale images itselfpublic void setCharacterEncoding(int encoding)
ENCODING_ISO_LATIN_1
(self-explanatory) or
ENCODING_ISO_LATIN_1_EURO
(the ISO Latin 1 set with the Euro
character added at decimal 128).
encoding
- the character encoding vector to usepublic int getCharacterEncoding()
ENCODING_ISO_LATIN_1
(self-explanatory) or
ENCODING_ISO_LATIN_1_EURO
(the ISO Latin 1 set with the Euro
character added at decimal 128).
public void openDocument(Rectangle2D pageSize)
openDocument
in class JCPrinter
pageSize
- the size of the default/first page of the documentpublic void closeDocument(Rectangle2D pageSize)
closeDocument
in class JCPrinter
pageSize
- the size of the default/last page of the documentpublic void beginPage(Rectangle2D pageSize, int pageNumber)
beginPage
in class JCPrinter
pageSize
- the dimensions of the new pagepageNumber
- public void endPage(Rectangle2D pageSize)
endPage
in class JCPrinter
pageSize
- the dimensions of the current pagepublic Graphics getGraphics()
Graphics
that draws to this printer.
getGraphics
in class JCPrinter
Graphics
object instantiated for this printer
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |