From: <doc...@us...> - 2007-07-26 18:24:20
|
Revision: 127 http://openpcl.svn.sourceforge.net/openpcl/?rev=127&view=rev Author: documentsystems Date: 2007-07-26 11:24:22 -0700 (Thu, 26 Jul 2007) Log Message: ----------- Howard Hoagland. In OpenPCLViewer in the methods renderImageForPrintingFromPageNumber() and getImageForPage(), added the parameter byte[] pPrintTimePclBytes and code in the methods to implement the "Print Form Names" for Windows Print (PCL Direct print was already implemented previously). Modified Paths: -------------- openpcl/src/com/openpcl/viewer/OpenPCLViewer.java Modified: openpcl/src/com/openpcl/viewer/OpenPCLViewer.java =================================================================== --- openpcl/src/com/openpcl/viewer/OpenPCLViewer.java 2007-07-26 18:20:14 UTC (rev 126) +++ openpcl/src/com/openpcl/viewer/OpenPCLViewer.java 2007-07-26 18:24:22 UTC (rev 127) @@ -1513,7 +1513,7 @@ // Get the image for the one selected Pcl page in the currently selected PosView its current zoom factor double tZoomFactor = mPosViewSelected.getPosZoomLogic().getCurrentZoomFactor(); - BufferedImage tBufferedImage = getImageForPage(tPageNumber, false, tPaperSize, tZoomFactor); + BufferedImage tBufferedImage = getImageForPage(tPageNumber, null, false, tPaperSize, tZoomFactor); PriDebug.infoln("OpenPCLViewer> returned from getImageForPage(tPageNumber, false, tPaperSize, tZoomFactor)"); // Pass the returned BufferedImage from above here to put it on the screen. @@ -1544,18 +1544,20 @@ public BufferedImage renderImageForPrintingFromTreeNode(PosTreeNode pPosTreeNode) { if (pPosTreeNode == null) { return null; } - // Pass only the page number of the tree node to PclRenderImage to render the BufferedImage. - // Important: Subclasses that override this method will have more complex code than just the one line below, - // so that's why there is only this one line is in this one method, so this method can be overridden in subclasses. - BufferedImage tBufferedImage = renderImageForPrintingFromPageNumber(pPosTreeNode.getNodeNumber()); + // Pass the page number of the tree node and the print time only additional PCL bytes to draw + // to PclRenderImage to render the BufferedImage. + // Important: Subclasses that override this method will have more complex code than just the below. + BufferedImage tBufferedImage = renderImageForPrintingFromPageNumber( + pPosTreeNode.getNodeNumber(), pPosTreeNode.getPrintTimePclBytes()); + return tBufferedImage; } - /** Render the BufferedImage from the page number. */ - public BufferedImage renderImageForPrintingFromPageNumber(int pPageNumber) { + /** Render the BufferedImage from the page number and the print time only additional PCL bytes to draw */ + public BufferedImage renderImageForPrintingFromPageNumber(int pPageNumber, byte[] pPrintTimePclBytes) { String tPaperSize = getPaperSizeForPage(pPageNumber); // Get the image for the one selected Pcl page in the currently selected PosView its current zoom factor - BufferedImage tBufferedImage = getImageForPage(pPageNumber, true, tPaperSize, 1.0d); + BufferedImage tBufferedImage = getImageForPage(pPageNumber, pPrintTimePclBytes, true, tPaperSize, 1.0d); return tBufferedImage; } @@ -1612,18 +1614,21 @@ * In DocMaster, this is getImage(). * * @param pPageNumber. The Pcl page number to render to the image. + * @param pPrintTimePclBytes. Draw these additional PCL bytes on the print image. * @param pIsForPrinting. If true non printing items like signature blocks won't be rendered. * @param pPaperSize. If a paper size is not specified in the PCL, this paper size will be used. "LTR" or "LGL". * @param pZoomFactor. This is mandatory (see note for why). - * @return returnserror String from PclRenderImage.getLastErrorString() + * @return BufferedImage. If null, then get the return String from PclRenderImage.getLastErrorString() */ - public BufferedImage getImageForPage(int pPageNumber, boolean pIsForPrinting, String pPaperSize, double pZoomFactor) { + public BufferedImage getImageForPage(int pPageNumber, byte[] pPrintTimePclBytes, + boolean pIsForPrinting, String pPaperSize, double pZoomFactor) { if (mPosViewSelected != null) { PriDebug.infoln("OpenPCLViewer> getImageForPage(page=" + pPageNumber + ", boolean printing=" + pIsForPrinting + "String paperSize=" + pPaperSize + ", double zoom=" + pZoomFactor + ")"); - return mPosViewSelected.getPclRenderImage().getImageForPage( - pPageNumber, pIsForPrinting, pPaperSize, pZoomFactor); + return mPosViewSelected.getPclRenderImage().getImageForPage(pPageNumber, pPrintTimePclBytes, + pIsForPrinting, pPaperSize, pZoomFactor); + } else { return null; } @@ -1676,7 +1681,7 @@ * Convenience method that calls PclRenderImage.getBufferedImageToDrawOn(). * Get the BufferedImage to draw on for purposes of an external app can call methods on the * BufferedImage object so the external app can directly draw on the image if wanted. - * @return BufferedImage or if error returns null in which case call getLastErrorString() + * @return BufferedImage. If null, then get the return String from PclRenderImage.getLastErrorString() */ public BufferedImage getBufferedImageToDrawOn() { if (mPosViewSelected != null) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |