|
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.pcl.JCPCLPrinter
Implements the PrinterDriver
interface.
Field Summary | |
protected static Rectangle2D.Double |
a3
A european A3-size page (one of the HP-supported paper sizes). |
protected static Rectangle2D.Double |
a4
A european A4-size page (one of the HP-supported paper sizes). |
protected Rectangle2D |
currentPageSize
Stores the size of the current page. |
protected static Rectangle2D.Double |
executive
An executive-size page (one of the HP-supported paper sizes). |
protected boolean |
isGL2Mode
Whether or not the printer was last set to be in GL2 mode. |
protected static Rectangle2D.Double |
ledger
A "ledger"-size page (11x17) (one of the HP-supported paper sizes). |
protected static Rectangle2D.Double |
legal
A legal-size page. |
protected static Rectangle2D.Double |
letter
A letter-size page (one of the HP-supported paper sizes). |
protected Rectangle2D |
oldPageSize
The last paper size that the output was set to accomodate. |
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 | |
JCPCLPrinter(OutputStream os)
Creates a PCL printer given an OutputStream to write the data to. |
|
JCPCLPrinter(OutputStream os,
com.klg.jclass.page.FontParser parser,
String jarLocation,
String fileExtension,
String fontMapFileName)
Constructor. |
Method Summary | |
void |
beginPage(Rectangle2D pageSize,
int pageNumber)
Begins a new page in the document; establishes the co-ordinate system, sets margins and clipping, etc. |
void |
closeDocument(Rectangle2D pageSize)
Completes the print job. |
void |
endPage(Rectangle2D pageSize)
Completes the page and advances to the next one. |
Graphics |
getGraphics()
Returns a graphics objects associated with this printer. |
protected int |
getPaperCode(double width,
double height)
Given width and height, returns the hp paper code. |
boolean |
isImageScalable()
Returns true since PCL printer does own image scaling. |
void |
openDocument(Rectangle2D pageSize)
Writes the PCL document header and setup information. |
protected boolean |
paperChanged(Rectangle2D pageSize)
Determines if the paper size or orientation has changed. |
void |
setup()
Creates default styles, any other one-time initialization (for example, builds font families from available fonts.). |
protected void |
setupPage(Rectangle2D pageSize)
Outputs the commands to size and orients the page. |
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 |
protected Rectangle2D oldPageSize
protected boolean isGL2Mode
protected Rectangle2D currentPageSize
protected static final Rectangle2D.Double letter
protected static final Rectangle2D.Double legal
protected static final Rectangle2D.Double executive
protected static final Rectangle2D.Double ledger
protected static final Rectangle2D.Double a4
protected static final Rectangle2D.Double a3
Constructor Detail |
public JCPCLPrinter(OutputStream os, com.klg.jclass.page.FontParser parser, String jarLocation, String fileExtension, String fontMapFileName)
JCPrinter p = new JCPCLPrinter( someOutputStream, // the output stream new com.klg.jclass.page.pcl.TFMParser(), // the parser "/com/klg/jclass/page/pcl/fonts.jar", // jar location ".tfm", // file extension "com.klg.jclass.page.pcl.JCPCLFontMap");
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 JCPCLPrinter(bos, ...);
os
- the OutputStream
to which formatted output should be sentparser
- the FontParser
which creates fonts from tfm filesjarLocation
- the location of the jar containing tfm 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 aliasespublic JCPCLPrinter(OutputStream os)
OutputStream
to write the data to.
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 JCPCLPrinter(bos);
os
- the OutputStream
to which to write the PCL dataMethod Detail |
public void setup()
setup
in class JCPrinter
public boolean isImageScalable()
true
since PCL printer does own image scaling.
isImageScalable
in class JCPrinter
true
since PCL printer does own image scalingpublic void openDocument(Rectangle2D pageSize)
openDocument
in class JCPrinter
pageSize
- the size of the first/default pagepublic void closeDocument(Rectangle2D pageSize)
closeDocument
in class JCPrinter
pageSize
- the size of the default/last pagepublic void beginPage(Rectangle2D pageSize, int pageNumber)
beginPage
in class JCPrinter
pageSize
- the size of the new pagepageNumber
- the number of the new page in the documentprotected void setupPage(Rectangle2D pageSize)
pageSize
- the dimensions of the current pageprotected int getPaperCode(double width, double height)
width
- the width of the page in pointsheight
- the height of the page in points
public void endPage(Rectangle2D pageSize)
endPage
in class JCPrinter
pageSize
- the size of the current pagepublic Graphics getGraphics()
getGraphics
in class JCPrinter
protected boolean paperChanged(Rectangle2D pageSize)
pageSize
- the size of the next page to output
true
if the next page is different from the old page
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |