Save This Page
Home » openjdk-7 » sun » print » [javadoc | source]
sun.print
public class: PSPrinterJob [javadoc | source]
java.lang.Object
   java.awt.print.PrinterJob
      sun.print.RasterPrinterJob
         sun.print.PSPrinterJob
A class which initiates and executes a PostScript printer job.
Nested Class Summary:
public static class  PSPrinterJob.PluginPrinter  PluginPrinter generates EPSF wrapped with a header and trailer comment. This conforms to the new requirements of Mozilla 1.7 and FireFox 1.5 and later. Earlier versions of these browsers did not support plugin printing in the general sense (not just Java). A notable limitation of these browsers is that they handle plugins which would span page boundaries by scaling plugin content to fit on a single page. This means white space is left at the bottom of the previous page and its impossible to print these cases as they appear on the web page. This is contrast to how the same browsers behave on Windows where it renders as on-screen. Cases where the content fits on a single page do work fine, and they are the majority of cases. The scaling that the browser specifies to make the plugin content fit when it is larger than a single page can hold is non-uniform. It scales the axis in which the content is too large just enough to ensure it fits. For content which is extremely long this could lead to noticeable distortion. However that is probably rare enough that its not worth compensating for that here, but we can revisit that if needed, and compensate by making the scale for the other axis the same. 
public static class  PSPrinterJob.EPSPrinter   
Field Summary
protected static final  int FILL_EVEN_ODD    Passed to the setFillMode method this value forces fills to be done using the even-odd fill rule. 
protected static final  int FILL_WINDING    Passed to the setFillMode method this value forces fills to be done using the non-zero winding rule. 
 FontMetrics mCurMetrics    The metrics for the font currently set. 
 PrintStream mPSStream    The output stream to which the generated PostScript is written. 
 File spoolFile     
 ArrayList mGStateStack    A stack that represents the PostScript gstate stack. 
Fields inherited from sun.print.RasterPrinterJob:
PRINTER,  FILE,  STREAM,  forcePDL,  forceRaster,  shapeTextProp,  sidesAttr,  destinationAttr,  noJobSheet,  mDestType,  mDestination,  collateAttReq,  landscapeRotates270,  attributes,  myService,  debugPrint
Constructor:
 public PSPrinterJob() 
Method from sun.print.PSPrinterJob Summary:
abortDoc,   beginPath,   bezierTo,   closeSubpath,   convertToPSPath,   createPathGraphics,   deviceFill,   drawImageBGR,   endDoc,   endPage,   fillPath,   getCollatedCopies,   getNoncollatedCopies,   getPenX,   getPenY,   getPhysicalPageHeight,   getPhysicalPageWidth,   getPhysicalPrintableHeight,   getPhysicalPrintableWidth,   getPhysicalPrintableX,   getPhysicalPrintableY,   getXRes,   getYRes,   lineTo,   moveTo,   platformFontCount,   printBand,   printDialog,   selectClipPath,   setClip,   setColor,   setFillMode,   setFont,   setTransform,   startDoc,   startPage,   textOut,   trunc
Methods from sun.print.RasterPrinterJob:
abortDoc,   cancel,   checkAllowedToPrintToFile,   createPathGraphics,   createPeekGraphics,   debug_println,   defaultPage,   endDoc,   endPage,   getCollatedCopies,   getCopies,   getCopiesInt,   getFirstPage,   getJobName,   getJobNameInt,   getLastPage,   getNoncollatedCopies,   getPageable,   getPhysicalPageHeight,   getPhysicalPageWidth,   getPhysicalPrintableHeight,   getPhysicalPrintableWidth,   getPhysicalPrintableX,   getPhysicalPrintableY,   getPrintService,   getPrinterGraphicsConfig,   getUserName,   getUserNameInt,   getXRes,   getYRes,   initPrinter,   initPrinterGraphics,   isCancelled,   isCollated,   isSupportedValue,   lookupDefaultPrintService,   pageDialog,   pageDialog,   print,   print,   printBand,   printDialog,   printDialog,   printPage,   removeControlChars,   saveState,   setAttributes,   setCollated,   setCopies,   setGraphicsConfigInfo,   setJobName,   setPageRange,   setPageable,   setPrintService,   setPrintable,   setPrintable,   startDoc,   startPage,   updatePageAttributes,   validatePage,   validatePaper
Methods from java.awt.print.PrinterJob:
cancel,   defaultPage,   defaultPage,   getCopies,   getJobName,   getPageFormat,   getPrintService,   getPrinterJob,   getUserName,   isCancelled,   lookupPrintServices,   lookupStreamPrintServices,   pageDialog,   pageDialog,   print,   print,   printDialog,   printDialog,   setCopies,   setJobName,   setPageable,   setPrintService,   setPrintable,   setPrintable,   validatePage
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from sun.print.PSPrinterJob Detail:
 protected  void abortDoc() 
    Invoked if the application cancelled the printjob.
 protected  void beginPath() 
    Called to mark the start of a new path.
 protected  void bezierTo(float control1x,
    float control1y,
    float control2x,
    float control2y,
    float endX,
    float endY) 
    Add to the current path a bezier curve formed by the current pen position and the method parameters which are two control points and an ending point.
 protected  void closeSubpath() 
    Close the current subpath by appending a straight line from the current point to the subpath's starting point.
  void convertToPSPath(PathIterator pathIter) 
    Given a Java2D PathIterator instance, this method translates that into a PostScript path..
 protected Graphics2D createPathGraphics(PeekGraphics peekGraphics,
    PrinterJob printerJob,
    Printable painter,
    PageFormat pageFormat,
    int pageIndex) 
    Examine the metrics captured by the PeekGraphics instance and if capable of directly converting this print job to the printer's control language or the native OS's graphics primitives, then return a PSPathGraphics to perform that conversion. If there is not an object capable of the conversion then return null. Returning null causes the print job to be rasterized.
 protected  void deviceFill(PathIterator pathIter,
    Color color,
    AffineTransform tx,
    Shape clip) 
 protected  void drawImageBGR(byte[] bgrData,
    float destX,
    float destY,
    float destWidth,
    float destHeight,
    float srcX,
    float srcY,
    float srcWidth,
    float srcHeight,
    int srcBitMapWidth,
    int srcBitMapHeight) 
    Convert the 24 bit BGR image buffer represented by image to PostScript. The image is drawn at (destX, destY) in device coordinates. The image is scaled into a square of size specified by destWidth and destHeight. The portion of the source image copied into that square is specified by srcX, srcY, srcWidth, and srcHeight.
 protected  void endDoc() throws PrinterException 
    Invoked by the RasterPrintJob super class this method is called after that last page has been imaged.
 protected  void endPage(PageFormat format,
    Printable painter,
    int index) throws PrinterException 
    The RastePrintJob super class calls this method at the end of each page.
 protected  void fillPath() 
    Fill the current path using the current fill mode and color.
 protected int getCollatedCopies() 
 protected int getNoncollatedCopies() 
    Returns how many times each page in the book should be consecutively printed by PrintJob. If the printer makes copies itself then this method should return 1.
 protected float getPenX() 
    Return the x coordinate of the pen in the current path.
 protected float getPenY() 
    Return the y coordinate of the pen in the current path.
 protected double getPhysicalPageHeight(Paper p) 
 protected double getPhysicalPageWidth(Paper p) 
 protected double getPhysicalPrintableHeight(Paper p) 
 protected double getPhysicalPrintableWidth(Paper p) 
 protected double getPhysicalPrintableX(Paper p) 
    For PostScript the origin is in the upper-left of the paper not at the imageable area corner.
 protected double getPhysicalPrintableY(Paper p) 
    For PostScript the origin is in the upper-left of the paper not at the imageable area corner.
 protected double getXRes() 
    Return the x resolution of the coordinates to be rendered.
 protected double getYRes() 
    Return the y resolution of the coordinates to be rendered.
 protected  void lineTo(float x,
    float y) 
    Generate PostScript to draw a line from the current pen position to (x, y).
 protected  void moveTo(float x,
    float y) 
    Generate PostScript to move the current pen position to (x, y).
 protected int platformFontCount(Font font,
    String str) 
 protected  void printBand(byte[] bgrData,
    int x,
    int y,
    int width,
    int height) throws PrinterException 
    Prints the contents of the array of ints, 'data' to the current page. The band is placed at the location (x, y) in device coordinates on the page. The width and height of the band is specified by the caller. Currently the data is 24 bits per pixel in BGR format.
 public boolean printDialog() throws HeadlessException 
    Presents the user a dialog for changing properties of the print job interactively.
 protected  void selectClipPath() 
    Intersect the gstate's current path with the current clip and make the result the new clip.
 protected  void setClip(Shape clip) 
 protected  void setColor(Color color) 
    Set the printer's current color to be that defined by color
 protected  void setFillMode(int fillRule) 
    Set the current path rule to be either FILL_EVEN_ODD (using the even-odd file rule) or FILL_WINDING (using the non-zero winding rule.)
 protected boolean setFont(Font font) 
    Set the current PostScript font. Taken from outFont in PSPrintStream.
 protected  void setTransform(AffineTransform transform) 
 protected  void startDoc() throws PrinterException 
    Invoked by the RasterPrinterJob super class this method is called to mark the start of a document.
 protected  void startPage(PageFormat pageFormat,
    Printable painter,
    int index,
    boolean paperChanged) throws PrinterException 
    The RasterPrintJob super class calls this method at the start of each page.
 protected boolean textOut(Graphics g,
    String str,
    float x,
    float y,
    Font mLastFont,
    FontRenderContext frc,
    float width) 
 String trunc(float f)