From: <doc...@us...> - 2007-07-02 18:35:17
|
Revision: 98 http://openpcl.svn.sourceforge.net/openpcl/?rev=98&view=rev Author: documentsystems Date: 2007-07-02 11:35:20 -0700 (Mon, 02 Jul 2007) Log Message: ----------- Howard Hoagland. Fixed bug where switching to white text using PCL command "ESC * v 1 T" to intentionally put in data in the PCL that won't show when viewed and printed, the text was correctly white text for viewing and printing but when converted to a PDF Acrobat file, the text was blue instead of white. The bug was happening because the text chars are buffered up and written as one string of chars instead of writing the chars one at a time, to make the PDF file smaller. The trigger to write the buffered up chars is on several PCL commands like any cursor position but wasn't on changing the text color. Modified Paths: -------------- openpcl/src/com/openpcl/pclrenderimage/PclRenderImage.java Modified: openpcl/src/com/openpcl/pclrenderimage/PclRenderImage.java =================================================================== --- openpcl/src/com/openpcl/pclrenderimage/PclRenderImage.java 2007-07-02 18:29:48 UTC (rev 97) +++ openpcl/src/com/openpcl/pclrenderimage/PclRenderImage.java 2007-07-02 18:35:20 UTC (rev 98) @@ -348,6 +348,7 @@ } else if (cmdCharArray[1] == 'v') { // *v if (cmdCharArray[2] == ',') { if (cmdCharArray[3] == 'T') { // *v,T + mPriDrawText.drawBufferedUpCharsAs1String(); // Set current Pattern. 0=black, 1=white. White text is put on top of rectangle draws sometimes mPriPageSettings.setPrintPattern(cmdValueInt); } else if (cmdCharArray[3] == 'N') { // *v,N This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <doc...@us...> - 2007-07-26 18:29:28
|
Revision: 128 http://openpcl.svn.sourceforge.net/openpcl/?rev=128&view=rev Author: documentsystems Date: 2007-07-26 11:29:28 -0700 (Thu, 26 Jul 2007) Log Message: ----------- Howard Hoagland. In PclRenderImage added a ByteArrayOutputStream that is constructed once and resused for each print page to build the resulting PCL bytes to parse and draw to the bitmap for Windows Print, in the method getImageForPage() appending the added parameter byte[] pPrintTimePclBytes then the base page PCL bytes to implement the "Print Form Names" for Windows Print (PCL Direct print was already implemented previously). Modified Paths: -------------- openpcl/src/com/openpcl/pclrenderimage/PclRenderImage.java Modified: openpcl/src/com/openpcl/pclrenderimage/PclRenderImage.java =================================================================== --- openpcl/src/com/openpcl/pclrenderimage/PclRenderImage.java 2007-07-26 18:24:22 UTC (rev 127) +++ openpcl/src/com/openpcl/pclrenderimage/PclRenderImage.java 2007-07-26 18:29:28 UTC (rev 128) @@ -4,6 +4,7 @@ import java.awt.Graphics2D; import java.awt.RenderingHints; import java.awt.image.BufferedImage; +import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; @@ -75,6 +76,7 @@ protected double mCurrentZoomFactor = sDefaultZoomFactor; protected PriPclPage mPriPclPage = null; protected ArrayList<PriPclPage> mPagesArrayList = null; + protected ByteArrayOutputStream mByteArrayOutputStream = null; protected String mFullFilePathAndName = null; protected String mFileNameNoPath = null; @@ -112,7 +114,12 @@ mPriRasterDrawing = new PriRasterDrawing(this, mBufferedImageToDrawOn); mPriRectDrawing = new PriRectDrawing(this, mGraphics2D); mPriPclPage = new PriPclPage(); - mPagesArrayList = new ArrayList<PriPclPage>(4); + mPagesArrayList = new ArrayList<PriPclPage>(10); // Grows automatically if max is reached + + // Make a new ByteArrayOutputStream to hold the Pcl bytes gotten from the BLK page or from the PCL file page, + // and make it 20k bytes. Note that ByteArrayOutputStream automatically grows the storage space if it + // runs out of room by allocating a new bigger byte array then doing a memcopy to the new one. + mByteArrayOutputStream = new ByteArrayOutputStream(20 * 1024); } } @@ -910,12 +917,14 @@ * 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 BufferedImage. If null is returned, then call 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) { // PriDebug.infoln("PclRenderImage> getImageForPage(page=" + pPageNumber + ", boolean printing=" + // pIsForPrinting + "String paperSize=" + pPaperSize + ", double zoom=" + pZoomFactor + ")"); @@ -929,6 +938,17 @@ return null; } + // Set the char pointer in the ByteArrayOutputStream to 0 bytes, to reuse it without doing a "new" to make a new one + mByteArrayOutputStream.reset(); + + // If rendering for printing, and there are additional print time PCL bytes to draw, then write those bytes here + if (pIsForPrinting && pPrintTimePclBytes != null) { + try { + mByteArrayOutputStream.write(pPrintTimePclBytes); + } catch (IOException e) { + } + } + // Pull the Pcl bytes for this page out of the PriPclPage byte[] tPclBytes = tPriPclPage.getPclBytes(); if (tPclBytes == null || tPclBytes.length < 1) { @@ -936,12 +956,24 @@ return null; } + // Save passed in parameter to class instance variable to be accessed during the printing mIsDrawingForPrinting = pIsForPrinting; + + // Write the Pcl bytes from the page + try { + mByteArrayOutputStream.write(tPclBytes); + } catch (IOException e) { + } // PriDebug.infoln("PclRenderImage> getImageForPage() calling parseAndRender(#bytes=" + tPclBytes.length + // ", printing=" + pIsForPrinting + ", zoom=" + pZoomFactor); - - return parseAndRender(tPclBytes, pIsForPrinting, pZoomFactor); + + // Get the byte[] out of the ByteArrayOutputStream + byte[] tBytesToRender = mByteArrayOutputStream.toByteArray(); + // Draw the PCL bytes on the BufferedImage + BufferedImage tBufferedImage = parseAndRender(tBytesToRender, pIsForPrinting, pZoomFactor); + // Return the BufferedImage + return tBufferedImage; } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <doc...@us...> - 2007-07-27 00:31:06
|
Revision: 131 http://openpcl.svn.sourceforge.net/openpcl/?rev=131&view=rev Author: documentsystems Date: 2007-07-26 17:31:03 -0700 (Thu, 26 Jul 2007) Log Message: ----------- Howard Hoagland. In PclRenderImage getGraphicsWithRenderHints(), changed KEY_DITHERING from disable to enable, changed KEY_INTERPOLATION from nearestNeighbor to Bicubic, changed KEY_STROKE_CONTROL from plain to normalize. Modified Paths: -------------- openpcl/src/com/openpcl/pclrenderimage/PclRenderImage.java Modified: openpcl/src/com/openpcl/pclrenderimage/PclRenderImage.java =================================================================== --- openpcl/src/com/openpcl/pclrenderimage/PclRenderImage.java 2007-07-26 20:48:42 UTC (rev 130) +++ openpcl/src/com/openpcl/pclrenderimage/PclRenderImage.java 2007-07-27 00:31:03 UTC (rev 131) @@ -653,7 +653,7 @@ // Pick text quality instead of speed tGraphics2D.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); // Turn dithering off. Dithering approximates color values by drawing groups of pixels of similar colors - tGraphics2D.setRenderingHint(RenderingHints.KEY_DITHERING, RenderingHints.VALUE_DITHER_DISABLE); + tGraphics2D.setRenderingHint(RenderingHints.KEY_DITHERING, RenderingHints.VALUE_DITHER_ENABLE); // Alpha composites for Quality tGraphics2D.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION, RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY); @@ -664,9 +664,9 @@ tGraphics2D.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_QUALITY); // Interpolating pixels when scaling or rotating images. tGraphics2D.setRenderingHint(RenderingHints.KEY_INTERPOLATION, - RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR); + RenderingHints.VALUE_INTERPOLATION_BICUBIC); // Combining strokes - tGraphics2D.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE); + tGraphics2D.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_NORMALIZE); // Used for any clear region operations tGraphics2D.setBackground(Color.WHITE); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <doc...@us...> - 2007-09-25 23:36:34
|
Revision: 174 http://openpcl.svn.sourceforge.net/openpcl/?rev=174&view=rev Author: documentsystems Date: 2007-09-25 16:36:34 -0700 (Tue, 25 Sep 2007) Log Message: ----------- Howard Hoagland. Add call to mPriPageSettings.setDuplexMode() when the duplex PCL command &l#S is parsed. Previously, all duplex cmds were being stripped out and not put back in one time at the top of the PCL bytes. Now, it strips out all duplex PCL cmds, then if the use picks Duplex=Yes on the print options dialog, then put in one duplex On command at the top of the PCL bytes. Modified Paths: -------------- openpcl/src/com/openpcl/pclrenderimage/PclRenderImage.java Modified: openpcl/src/com/openpcl/pclrenderimage/PclRenderImage.java =================================================================== --- openpcl/src/com/openpcl/pclrenderimage/PclRenderImage.java 2007-09-25 23:31:13 UTC (rev 173) +++ openpcl/src/com/openpcl/pclrenderimage/PclRenderImage.java 2007-09-25 23:36:34 UTC (rev 174) @@ -414,7 +414,8 @@ } else if (cmdCharArray[3] == 'O') { //&l,O // TODO Page orientation Portrait or Landscape } else if (cmdCharArray[3] == 'S') { //&l,S - // TODO Simplex/Duplex + // Duplex mode. 0=off (simplex), 1=Duplex on Long Edge of page, 2=Duplex on Short Edge of page + mPriPageSettings.setDuplexMode(cmdValueInt); } else if (cmdCharArray[3] == 'X') { //&l,X // TODO Number of Copies } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <doc...@us...> - 2007-12-07 22:12:07
|
Revision: 212 http://openpcl.svn.sourceforge.net/openpcl/?rev=212&view=rev Author: documentsystems Date: 2007-12-07 14:12:12 -0800 (Fri, 07 Dec 2007) Log Message: ----------- Howard Hoagland. Deleted the "synchronized" off of the parseAndRender() method so that when several threads are executing at the same time on a server in the same JVM, but each one did a "new" to get their own PclRenderImage, more than one thread can be executing the parseAndRender() method at the same time instead of only one thread can execute in the method at a time. Modified Paths: -------------- openpcl/src/com/openpcl/pclrenderimage/PclRenderImage.java Modified: openpcl/src/com/openpcl/pclrenderimage/PclRenderImage.java =================================================================== --- openpcl/src/com/openpcl/pclrenderimage/PclRenderImage.java 2007-12-05 21:15:26 UTC (rev 211) +++ openpcl/src/com/openpcl/pclrenderimage/PclRenderImage.java 2007-12-07 22:12:12 UTC (rev 212) @@ -28,7 +28,7 @@ //import com.openpcl.pclrenderimage.util.PriDebug; /** - * PclRenderImage may be used with or without the openpcl.jar file. If you imbed the OpenPCLViewer JPanel + * PclRenderImage may be used with or without the openpcl.jar file. If you embed the OpenPCLViewer JPanel * in your app, then you need the openpcljar file. But if your app has all the UI code you need, and all you * want is to pass in PCL bytes to render and put the BufferedImage bitmap on your screen, then you don't need * the openpcl.jar file at all. @@ -47,9 +47,9 @@ * * The implemented interface IPclRenderImage are call into methods that can return Object values. * The implemented interface PclCommandEvent is in RmsTools. - * There are no callback methods that the class that instantiated this class must impelement. + * There are no callback methods that the class that instantiated this class must implement. * - * @author DocMagic, Document Systems Inc, Howard. Rendering code written May 16 2006 to July 20 2006. + * @author DocMagic, Document Systems Inc, Howard Hoagland. Rendering code written May 16 2006 to July 20 2006. */ public class PclRenderImage implements IPclRenderImage, PclCommandEvent { protected PclParser mPclParser = null; // PclParser in RmsTools @@ -726,7 +726,7 @@ * @param pAtZoomFactor * @return If error returns error String. If no error then returns null */ - protected synchronized BufferedImage parseAndRender(byte[] pPclBytes, boolean pIsForPrinting, double pAtZoomFactor) { + protected BufferedImage parseAndRender(byte[] pPclBytes, boolean pIsForPrinting, double pAtZoomFactor) { // Error check for no PCL bytes to parse to build the tree pages nodes from if (pPclBytes == null || pPclBytes.length < 1) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <doc...@us...> - 2008-03-31 20:42:57
|
Revision: 220 http://openpcl.svn.sourceforge.net/openpcl/?rev=220&view=rev Author: documentsystems Date: 2008-03-31 13:42:51 -0700 (Mon, 31 Mar 2008) Log Message: ----------- Change numeric argument to processMiscKCommand to by type float rather than int. This allows for more precision. Modified Paths: -------------- openpcl/src/com/openpcl/pclrenderimage/PclRenderImage.java Modified: openpcl/src/com/openpcl/pclrenderimage/PclRenderImage.java =================================================================== --- openpcl/src/com/openpcl/pclrenderimage/PclRenderImage.java 2008-03-31 20:39:54 UTC (rev 219) +++ openpcl/src/com/openpcl/pclrenderimage/PclRenderImage.java 2008-03-31 20:42:51 UTC (rev 220) @@ -301,7 +301,7 @@ } else if (cmdLeadin.equals(PCL_EXECUTE)) { processExecuteCommand(cmdTerminator, pBufferPos, cmdValueInt); } else if (cmdLeadin.equals(PCL_MISC_K)) { - processMiscKCommand(cmdTerminator, cmdValueInt); + processMiscKCommand(cmdTerminator, cmdValueFloat); } else if (cmdLeadin.equals(PCL_UNIT)) { processUnitCommand(cmdTerminator, cmdValueInt); } else if (cmdLeadin.equals(PCL_SECONDARY_FONT)) { @@ -455,12 +455,12 @@ * @param cmdTerminator * @param cmdValueInt */ -private void processMiscKCommand(char cmdTerminator, int cmdValueInt) { +private void processMiscKCommand(char cmdTerminator, float cmdValue) { switch(cmdTerminator){ case 'H': if (mIsStateBuildingPclPages || mIsRecordingAMacro) { return; } mPriDrawText.drawBufferedUpCharsAs1String(); - mPriFonts.setHorizontalMotionIndexHMI(cmdValueInt); + mPriFonts.setHorizontalMotionIndexHMI(cmdValue); break; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |