You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(6) |
Jun
(19) |
Jul
(39) |
Aug
(30) |
Sep
(14) |
Oct
(4) |
Nov
(12) |
Dec
(20) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
|
Feb
(1) |
Mar
(5) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(1) |
Dec
(2) |
2009 |
Jan
(3) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <doc...@us...> - 2010-05-12 17:43:10
|
Revision: 232 http://openpcl.svn.sourceforge.net/openpcl/?rev=232&view=rev Author: documentsystems Date: 2010-05-12 17:43:04 +0000 (Wed, 12 May 2010) Log Message: ----------- Modified Paths: -------------- openpcl/src/com/openpcl/pclrenderimage/render/PriFonts.java Modified: openpcl/src/com/openpcl/pclrenderimage/render/PriFonts.java =================================================================== --- openpcl/src/com/openpcl/pclrenderimage/render/PriFonts.java 2010-05-11 18:41:31 UTC (rev 231) +++ openpcl/src/com/openpcl/pclrenderimage/render/PriFonts.java 2010-05-12 17:43:04 UTC (rev 232) @@ -427,7 +427,7 @@ mCurrentHorizontalPitch = pNumCharactersPerInch; } - mCurrentHorizontalMotionIndexHMI = (120 / mCurrentHorizontalPitch); +// removed jfg 5.11.2010 mCurrentHorizontalMotionIndexHMI = (120 / mCurrentHorizontalPitch); // PriDebug.infoln(PriDebug.spacesForPclParseMsgs + // "PriFonts set Horizontal Pitch (number of characters per inch) to " + mCurrentHorizontalPitch); makeFontCurrent(); @@ -455,6 +455,7 @@ */ public void setHorizontalMotionIndexHMI(float pHmiValue) { mCurrentHorizontalMotionIndexHMI = pHmiValue; + mCurrentHorizontalPitch = (120 / mCurrentHorizontalMotionIndexHMI); // PriDebug.infoln(PriDebug.spacesForPclParseMsgs + // "PriFonts set Horizontal Motion Index (HMI) to " + pHmiValue); @@ -504,10 +505,11 @@ if (mCurrentJavaBuiltInFont == sFontIsMonospaced) { // For monospaced font (Courier), initialize to HMI 12 and CPI 10 - if (mCurrentHorizontalMotionIndexHMI == 0) { //don't reset the HMI if it has already been set + if (mCurrentHorizontalMotionIndexHMI == 0) { //don't reset the HMI or Pitch if it has already been set jfg 5.11.2010 mCurrentHorizontalMotionIndexHMI = 12; + mCurrentHorizontalPitch = 10; } - mCurrentHorizontalPitch = 10; + mCurrentFontStylePlanBoldItalic = Font.PLAIN; mCurrentFontHeight = 12.0f; } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <doc...@us...> - 2010-05-11 18:41:37
|
Revision: 231 http://openpcl.svn.sourceforge.net/openpcl/?rev=231&view=rev Author: documentsystems Date: 2010-05-11 18:41:31 +0000 (Tue, 11 May 2010) Log Message: ----------- Modified Paths: -------------- openpcl/src/com/openpcl/pclrenderimage/render/PriFonts.java Modified: openpcl/src/com/openpcl/pclrenderimage/render/PriFonts.java =================================================================== --- openpcl/src/com/openpcl/pclrenderimage/render/PriFonts.java 2009-02-05 19:20:48 UTC (rev 230) +++ openpcl/src/com/openpcl/pclrenderimage/render/PriFonts.java 2010-05-11 18:41:31 UTC (rev 231) @@ -504,7 +504,9 @@ if (mCurrentJavaBuiltInFont == sFontIsMonospaced) { // For monospaced font (Courier), initialize to HMI 12 and CPI 10 - mCurrentHorizontalMotionIndexHMI = 12; + if (mCurrentHorizontalMotionIndexHMI == 0) { //don't reset the HMI if it has already been set + mCurrentHorizontalMotionIndexHMI = 12; + } mCurrentHorizontalPitch = 10; mCurrentFontStylePlanBoldItalic = Font.PLAIN; mCurrentFontHeight = 12.0f; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <doc...@us...> - 2009-01-28 18:40:12
|
Revision: 228 http://openpcl.svn.sourceforge.net/openpcl/?rev=228&view=rev Author: documentsystems Date: 2009-01-28 18:40:09 +0000 (Wed, 28 Jan 2009) Log Message: ----------- Fixed jumpy page <developer tab> to <other tab> in firefox Modified Paths: -------------- openpcl/src/com/openpcl/install/website/index.html Modified: openpcl/src/com/openpcl/install/website/index.html =================================================================== --- openpcl/src/com/openpcl/install/website/index.html 2009-01-28 00:41:16 UTC (rev 227) +++ openpcl/src/com/openpcl/install/website/index.html 2009-01-28 18:40:09 UTC (rev 228) @@ -3,6 +3,7 @@ <head> <title>OpenPCL Open Source PCL Viewer</title> <style type="text/css"> + html { overflow: -moz-scrollbars-vertical; overflow-x: auto; } body, td { font-family:Tahoma,Arial; font-size:10pt; color:#808080; } #mainDiv { margin-top:25px; margin-bottom:25px; } /* #taglineDiv { position:relative; top:5px; text-align:right; } */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <doc...@us...> - 2009-01-28 00:41:25
|
Revision: 227 http://openpcl.svn.sourceforge.net/openpcl/?rev=227&view=rev Author: documentsystems Date: 2009-01-28 00:41:16 +0000 (Wed, 28 Jan 2009) Log Message: ----------- Spelled out release date Modified Paths: -------------- openpcl/src/com/openpcl/install/website/index.html Modified: openpcl/src/com/openpcl/install/website/index.html =================================================================== --- openpcl/src/com/openpcl/install/website/index.html 2009-01-28 00:24:37 UTC (rev 226) +++ openpcl/src/com/openpcl/install/website/index.html 2009-01-28 00:41:16 UTC (rev 227) @@ -226,7 +226,7 @@ <div id="downloadWin32Div"> <a href="openpclviewer-setup.exe" class="downloadLink"> Download OpenPCL Viewer Now!</a><br/> - v0.09 01/28/09 for Windows<br/> + v0.09 Jan 28 2009 for Windows<br/> </div> <div id="downloadOtherDiv" style="display:none"> <a href="openpclviewer-installer.jar" class="downloadLink"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <doc...@us...> - 2009-01-28 00:24:45
|
Revision: 226 http://openpcl.svn.sourceforge.net/openpcl/?rev=226&view=rev Author: documentsystems Date: 2009-01-28 00:24:37 +0000 (Wed, 28 Jan 2009) Log Message: ----------- Version changed to 0.09 January 28, 2009 Modified Paths: -------------- openpcl/src/com/openpcl/install/localinstaller/HelpAbout.html openpcl/src/com/openpcl/install/localinstaller/LicenseInfo.html openpcl/src/com/openpcl/install/localinstaller/openpclviewer-izpack-shortcut-win.xml openpcl/src/com/openpcl/install/localinstaller/openpclviewer-izpack.xml openpcl/src/com/openpcl/install/website/index.html openpcl/src/com/openpcl/viewer/htmlfiles/HelpAbout.html openpcl/src/com/openpcl/viewer/htmlfiles/LicenseInfo.html Modified: openpcl/src/com/openpcl/install/localinstaller/HelpAbout.html =================================================================== --- openpcl/src/com/openpcl/install/localinstaller/HelpAbout.html 2008-12-11 01:14:38 UTC (rev 225) +++ openpcl/src/com/openpcl/install/localinstaller/HelpAbout.html 2009-01-28 00:24:37 UTC (rev 226) @@ -2,7 +2,7 @@ <html><head><title>OpenPCL Viewer Help About</title></head> <body><font size=4 face="arial"> <b>OpenPCL Viewer - Free Open Source PCL Viewer for the World.</b><br> -Version 0.08 December 5, 2007<br> +Version 0.09 January 28, 2009<br> OpenPCL is made up of OpenPCLViewer and PclRenderImage.<br> <br> <b>Features:</b> Modified: openpcl/src/com/openpcl/install/localinstaller/LicenseInfo.html =================================================================== --- openpcl/src/com/openpcl/install/localinstaller/LicenseInfo.html 2008-12-11 01:14:38 UTC (rev 225) +++ openpcl/src/com/openpcl/install/localinstaller/LicenseInfo.html 2009-01-28 00:24:37 UTC (rev 226) @@ -2,7 +2,7 @@ <html><head><title>OpenPCL Viewer License</title></head> <body><font size=4 face="arial"> <b>OpenPCL Viewer - Free Open Source PCL Viewer for the World.</b> -<br>Version 0.08 December 5, 2007 +<br>Version 0.09 January 28, 2009 <br>OpenPCL is made up of OpenPCLViewer and PclRenderImage. <br> <p>The OpenPCL license is the GNU Lesser General Public License (LGPL) which you can view at Modified: openpcl/src/com/openpcl/install/localinstaller/openpclviewer-izpack-shortcut-win.xml =================================================================== --- openpcl/src/com/openpcl/install/localinstaller/openpclviewer-izpack-shortcut-win.xml 2008-12-11 01:14:38 UTC (rev 225) +++ openpcl/src/com/openpcl/install/localinstaller/openpclviewer-izpack-shortcut-win.xml 2009-01-28 00:24:37 UTC (rev 226) @@ -12,7 +12,7 @@ workingDirectory="$INSTALL_PATH\" commandLine="" iconFile="$INSTALL_PATH\openpclviewer.ico" - description="OpenPCL Viewer - Free Open Source PCL Viewer for the World. Version 0.08 December 5, 2007"> + description="OpenPCL Viewer - Free Open Source PCL Viewer for the World. Version 0.09 January 28, 2009"> <createForPack name="Core"/> </shortcut> <shortcut name="Uninstall OpenPCLViewer (local install)" Modified: openpcl/src/com/openpcl/install/localinstaller/openpclviewer-izpack.xml =================================================================== --- openpcl/src/com/openpcl/install/localinstaller/openpclviewer-izpack.xml 2008-12-11 01:14:38 UTC (rev 225) +++ openpcl/src/com/openpcl/install/localinstaller/openpclviewer-izpack.xml 2009-01-28 00:24:37 UTC (rev 226) @@ -2,7 +2,7 @@ <installation version="1.0"> <info> <appname>OpenPCLViewer</appname> - <appversion>OpenPCL Viewer - Free Open Source PCL Viewer for the World. Version 0.08 December 5, 2007</appversion> + <appversion>OpenPCL Viewer - Free Open Source PCL Viewer for the World. Version 0.09 January 28, 2009</appversion> <appsubpath>OpenPCLViewer</appsubpath> <url>http://www.openpcl.com</url> <authors> Modified: openpcl/src/com/openpcl/install/website/index.html =================================================================== --- openpcl/src/com/openpcl/install/website/index.html 2008-12-11 01:14:38 UTC (rev 225) +++ openpcl/src/com/openpcl/install/website/index.html 2009-01-28 00:24:37 UTC (rev 226) @@ -226,12 +226,12 @@ <div id="downloadWin32Div"> <a href="openpclviewer-setup.exe" class="downloadLink"> Download OpenPCL Viewer Now!</a><br/> - v0.08 12/5/07 for Windows<br/> + v0.09 01/28/09 for Windows<br/> </div> <div id="downloadOtherDiv" style="display:none"> <a href="openpclviewer-installer.jar" class="downloadLink"> Download OpenPCL Viewer Now!</a><br/> - v0.08 12/5/07 for Mac/Linux<br/> + v0.09 01/28/09 for Mac/Linux<br/> <span class="downloadReq"> Requires Java JRE 1.5<br/> </span> @@ -266,7 +266,7 @@ <a href="javascript:loadContent('developers')" class="copyright">Developer</a> | <a href="javascript:loadContent('contact')" class="copyright">Contact</a> </td> - <td align="right" class="copyright">Copyright 2007 OpenPCL. Sponsored by <a href="http://www.docmagic.com" class="copyright">DocMagic, Inc.</a></td> + <td align="right" class="copyright">Copyright 2009 OpenPCL. Sponsored by <a href="http://www.docmagic.com" class="copyright">DocMagic, Inc.</a></td> </tr> </table> </div> Modified: openpcl/src/com/openpcl/viewer/htmlfiles/HelpAbout.html =================================================================== --- openpcl/src/com/openpcl/viewer/htmlfiles/HelpAbout.html 2008-12-11 01:14:38 UTC (rev 225) +++ openpcl/src/com/openpcl/viewer/htmlfiles/HelpAbout.html 2009-01-28 00:24:37 UTC (rev 226) @@ -2,7 +2,7 @@ <html><head><title>OpenPCL Viewer Help About</title></head> <body><font size=4 face="arial"> <b>OpenPCL Viewer - Free Open Source PCL Viewer for the World.</b><br> -Version 0.08 December 5, 2007<br> +Version 0.09 January 28, 2009<br> OpenPCL is made up of OpenPCLViewer and PclRenderImage.<br> <br> <b>Features:</b> Modified: openpcl/src/com/openpcl/viewer/htmlfiles/LicenseInfo.html =================================================================== --- openpcl/src/com/openpcl/viewer/htmlfiles/LicenseInfo.html 2008-12-11 01:14:38 UTC (rev 225) +++ openpcl/src/com/openpcl/viewer/htmlfiles/LicenseInfo.html 2009-01-28 00:24:37 UTC (rev 226) @@ -2,7 +2,7 @@ <html><head><title>OpenPCL Viewer License</title></head> <body><font size=4 face="arial"> <b>OpenPCL Viewer - Free Open Source PCL Viewer for the World.</b> -<br>Version 0.08 December 5, 2007 +<br>Version 0.09 January 28, 2009 <br>OpenPCL is made up of OpenPCLViewer and PclRenderImage. <br> <p>The OpenPCL license is the GNU Lesser General Public License (LGPL) which you can view at This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <doc...@us...> - 2008-12-11 01:14:43
|
Revision: 225 http://openpcl.svn.sourceforge.net/openpcl/?rev=225&view=rev Author: documentsystems Date: 2008-12-11 01:14:38 +0000 (Thu, 11 Dec 2008) Log Message: ----------- Fixed code to handle binary data which may exist in pcl macros. While a macro is recording, charData should not be processed. Also, when a Macro is started, all pcl commands can be ignored until a Stop Macro is issued. 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-12-08 23:28:34 UTC (rev 224) +++ openpcl/src/com/openpcl/pclrenderimage/PclRenderImage.java 2008-12-11 01:14:38 UTC (rev 225) @@ -220,6 +220,9 @@ } public void charFoundEvent(char nextChar, int pBufferPos) { + // Skip bytes when the start macro command has been encountered and didn't get stop macro yet + if (mIsRecordingAMacro) { return; } //jfg added 12.10.2008 in case there is a binary FF in the recorded macro + if (nextChar == scFF) { // form feed mPriDrawText.drawBufferedUpCharsAs1String(); handleFormFeedFound(pBufferPos); @@ -502,13 +505,11 @@ break; case 'X': switch (cmdValueInt) { - case 0: // &f0X - if (mIsStateBuildingPclPages) { return; } + case 0: // &f0X jfg 12.10.2008 removed --> if (mIsStateBuildingPclPages) { return; } mIsRecordingAMacro = true; mPriParseMacroBytes.startMacroDefinition(pBufferPos); break; - case 1: // &f1X - if (mIsStateBuildingPclPages) { return; } + case 1: // &f1X jfg 12.10.2008 removed --> if (mIsStateBuildingPclPages) { return; } mPriParseMacroBytes.stopMacroDefinition(pBufferPos, mCurrentClickedPagePclBytes); mIsRecordingAMacro = false; break; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <doc...@us...> - 2008-12-08 23:28:43
|
Revision: 224 http://openpcl.svn.sourceforge.net/openpcl/?rev=224&view=rev Author: documentsystems Date: 2008-12-08 23:28:34 +0000 (Mon, 08 Dec 2008) Log Message: ----------- Removed system.out Modified Paths: -------------- openpcl/src/com/openpcl/pclrenderimage/tools/PclParser.java Modified: openpcl/src/com/openpcl/pclrenderimage/tools/PclParser.java =================================================================== --- openpcl/src/com/openpcl/pclrenderimage/tools/PclParser.java 2008-11-26 23:59:17 UTC (rev 223) +++ openpcl/src/com/openpcl/pclrenderimage/tools/PclParser.java 2008-12-08 23:28:34 UTC (rev 224) @@ -93,7 +93,6 @@ callbackObject.charFoundEvent( ch, bufferPos ); } } - System.out.println("parsed " + bufferPos + " bytes"); } catch (ParseException pe) { System.out.println("Unable to complete PCL parsing."); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <doc...@us...> - 2008-11-26 23:59:21
|
Revision: 223 http://openpcl.svn.sourceforge.net/openpcl/?rev=223&view=rev Author: documentsystems Date: 2008-11-26 23:59:17 +0000 (Wed, 26 Nov 2008) Log Message: ----------- 1) PCL Push/Pop cursor position implemented 2) Reset cursor position to x=0, y=0 on subsequent page parse Modified Paths: -------------- openpcl/src/com/openpcl/pclrenderimage/PclRenderImage.java openpcl/src/com/openpcl/pclrenderimage/render/PriCursorPos.java openpcl/src/com/openpcl/pclrenderimage/tools/PclParser.java openpcl/src/com/openpcl/viewer/OpenPCLViewer.java Modified: openpcl/src/com/openpcl/pclrenderimage/PclRenderImage.java =================================================================== --- openpcl/src/com/openpcl/pclrenderimage/PclRenderImage.java 2008-10-17 15:59:12 UTC (rev 222) +++ openpcl/src/com/openpcl/pclrenderimage/PclRenderImage.java 2008-11-26 23:59:17 UTC (rev 223) @@ -10,6 +10,7 @@ import java.io.FileNotFoundException; import java.io.IOException; import java.util.ArrayList; +import java.util.Stack; import com.openpcl.pclrenderimage.api.IPclRenderImage; import com.openpcl.pclrenderimage.render.PriCharWidthTables; @@ -90,6 +91,7 @@ protected PriCharWidthTables mPriCharWidthTables = null; protected PriCursorPos mPriCursorPos = null; + protected Stack<PriCursorPos> mPriCursorStack = null; protected PriDrawText mPriDrawText = null; protected PriFonts mPriFonts = null; protected PriPageSettings mPriPageSettings = null; @@ -135,9 +137,10 @@ if (mBufferedImageToDrawOn != null) { mGraphics2D = getGraphicsWithRenderHints(mBufferedImageToDrawOn); - // Instantiate supporing objects that this class has a reference to + // Instantiate supporting objects that this class has a reference to mPriCharWidthTables = new PriCharWidthTables(); mPriCursorPos = new PriCursorPos(this); + mPriCursorStack = new Stack<PriCursorPos>(); mPriDrawText = new PriDrawText(this, mGraphics2D); mPriFonts = new PriFonts(this, mGraphics2D); mPriPageSettings = new PriPageSettings(); @@ -272,14 +275,15 @@ */ try { // The command value is null for some commands, a parseFloat will throw an exception under this condition - if(cmdValue != null){ + if((cmdValue != null)&&(cmdValue != "")) { // Use Float.parseFloat() then Math.round() because when cmdValue is "10.00", - // Interger.parseInt() returns 0 instead of 10 + // Integer.parseInt() returns 0 instead of 10 cmdValueFloat = Float.parseFloat(cmdValue); cmdValueInt = Math.round(cmdValueFloat); } - } catch (NumberFormatException e) { - } + } catch (NumberFormatException e) { + } + // The "if else" is nested for parse speed instead of a 1 level long string compare chain. // The most frequently used commands should be nearer the top. if(cmdLeadin.equals(PCL_POSITION)){ // Position command @@ -312,7 +316,7 @@ processPrimaryFontCommand(cmdTerminator, cmdValueInt); } else if (cmdLeadin.equals(PCL_RESET)) { processResetCommand(); - } + } } private void processResetCommand() { @@ -472,6 +476,25 @@ */ private void processExecuteCommand(char cmdTerminator, int pBufferPos, int cmdValueInt) { switch(cmdTerminator){ + case 'S': //jfg added push/pop commands 11.10.2008 + switch (cmdValueInt) { + case 0: // &f0S PUSH cursor position + if (mIsStateBuildingPclPages || mIsRecordingAMacro) { return; } + //clone the current position object and place it onto the stack + PriCursorPos tPriCursorPos = (PriCursorPos)mPriCursorPos.clone(); + //place the saved cursor position onto the stack + mPriCursorStack.push(tPriCursorPos); + break; + case 1: // &f1S POP cursor position + if (mIsStateBuildingPclPages || mIsRecordingAMacro) { return; } + if (!mPriCursorStack.empty()){ + //get the last position off the stack + mPriCursorPos = mPriCursorStack.pop(); + } + break; + } + break; + case 'Y': if (mIsStateBuildingPclPages) { return; } mPriDrawText.drawBufferedUpCharsAs1String(); @@ -634,6 +657,7 @@ private void processShadeTransparencyCommand(char cmdTerminator, int cmdValueInt) { switch(cmdTerminator){ case 'T': + if (mIsStateBuildingPclPages || mIsRecordingAMacro) { return; } mPriDrawText.drawBufferedUpCharsAs1String(); // Set current Pattern. 0=black, 1=white. White text is put on top of rectangle draws sometimes mPriPageSettings.setPrintPattern(cmdValueInt); @@ -935,7 +959,7 @@ * Also some Blockument pages start with Fill instead of non fill text don't specifiy a font or LPI or top margin */ mPriFonts.setJavaBuiltInFont(4099); mPriPageSettings.setToInitialValues(); - + mPriCursorPos.setToInitialValues();//jfg fixed 11/06/2008 - without this, multiple parses of the same byte stream have xPos and yPos would never be reset mPclParser = new PclParser(mCurrentClickedPagePclBytes, this); // Parse the PCL bytes from the RmsTools PclParser mPclParser.ParsePCL(); // does callbacks to the 2 interface methods below as necessary (making the BufferedImage) Modified: openpcl/src/com/openpcl/pclrenderimage/render/PriCursorPos.java =================================================================== --- openpcl/src/com/openpcl/pclrenderimage/render/PriCursorPos.java 2008-10-17 15:59:12 UTC (rev 222) +++ openpcl/src/com/openpcl/pclrenderimage/render/PriCursorPos.java 2008-11-26 23:59:17 UTC (rev 223) @@ -9,12 +9,22 @@ * All the Cursor positioning * @author howard 5/16/2006 */ -public class PriCursorPos { - protected PclRenderImage mPclRenderImage = null; +public class PriCursorPos implements Cloneable { + protected PclRenderImage mPclRenderImage = null; - /** The current X and Y drawing position */ - protected int mXpos = 0; - protected int mYpos = 0; + /** The current X and Y drawing position */ + protected int mXpos = 0; + protected int mYpos = 0; + + //clone implemented for PUSH and POP PCL cmds + public Object clone() { + try { + return super.clone(); + } + catch (CloneNotSupportedException e) { + throw new InternalError(e.toString()); + } + } /** * Constructor Modified: openpcl/src/com/openpcl/pclrenderimage/tools/PclParser.java =================================================================== --- openpcl/src/com/openpcl/pclrenderimage/tools/PclParser.java 2008-10-17 15:59:12 UTC (rev 222) +++ openpcl/src/com/openpcl/pclrenderimage/tools/PclParser.java 2008-11-26 23:59:17 UTC (rev 223) @@ -82,23 +82,24 @@ public void ParsePCL() { int bufInt; - char ch; + char ch; try { while (( bufInt = buffer.read() ) != -1) { bufferPos++; // = 1; - ch = (char)bufInt; + ch = (char)bufInt; if ( ch == scESC ) { // We have an escape: getPclCommands(); // Loop for all parts of the command } else { callbackObject.charFoundEvent( ch, bufferPos ); } } + System.out.println("parsed " + bufferPos + " bytes"); } catch (ParseException pe) { System.out.println("Unable to complete PCL parsing."); pe.printStackTrace(); } - catch (IOException e) { e.printStackTrace(); } + catch (IOException e) { e.printStackTrace(); } } public void getPclCommands() throws ParseException, IOException { @@ -152,7 +153,21 @@ * ex: Soft font header: ')sxxW'; Transfer Raster: '*b,W'; etc. */ if ((pclState==4 || pclState==6 || pclState==7) && cmdTerminator == 'W' ) { - int numChars = Integer.parseInt( cmdValue ); // BOA ERROR: Throwing 'NumberFormatException' ? (Blank string) + int numChars = 0; + + try + { + + numChars = Integer.parseInt( cmdValue ); + } + catch (NumberFormatException e) + { + // TODO Auto-generated catch block + System.out.println(cmdValue); + e.printStackTrace(); + } + + // BOA ERROR: Throwing 'NumberFormatException' ? (Blank string) cmdData = GetBytesFromBuffer( numChars ); pclState = Math.min(pclState + 1, 7 ); // 4 becomes 5, 6 becomes 7 ?? } else { Modified: openpcl/src/com/openpcl/viewer/OpenPCLViewer.java =================================================================== --- openpcl/src/com/openpcl/viewer/OpenPCLViewer.java 2008-10-17 15:59:12 UTC (rev 222) +++ openpcl/src/com/openpcl/viewer/OpenPCLViewer.java 2008-11-26 23:59:17 UTC (rev 223) @@ -755,6 +755,8 @@ tPosFileFilter.addExtension("pcl"); tPosFileFilter.addExtension("prn"); tPosFileFilter.addExtension("tem"); + tPosFileFilter.addExtension("txt");//jfg + tPosFileFilter.setDescription("PCL Files"); return tPosFileFilter; } @@ -1325,6 +1327,8 @@ /** Determine the file type by the file extension. * Subclass plugins override this method so do not delete or rename this method. */ public int determineFileTypeByFileExtension(String pExtensionOfFileName) { + return sFileTypePCL; //jfg : removed logic to open all files by extension +/** if (pExtensionOfFileName.equalsIgnoreCase(".PCL") || pExtensionOfFileName.equalsIgnoreCase(".PRN") || pExtensionOfFileName.equalsIgnoreCase(".TEM")) { @@ -1333,6 +1337,7 @@ } else { return sFileTypeNotSupported; } + */ } /** Show the zoom factor in the toolbar button JLabel.setText() */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <doc...@us...> - 2008-10-17 15:59:21
|
Revision: 222 http://openpcl.svn.sourceforge.net/openpcl/?rev=222&view=rev Author: documentsystems Date: 2008-10-17 15:59:12 +0000 (Fri, 17 Oct 2008) Log Message: ----------- Fix algorithm for decompressing run length compression in decompressRL. Previously the control byte value was interpreted as one-based but it should be zero-based. I.e. zero means include the following byte value one time. Modified Paths: -------------- openpcl/src/com/openpcl/pclrenderimage/render/PriDecompressPclBytes.java Modified: openpcl/src/com/openpcl/pclrenderimage/render/PriDecompressPclBytes.java =================================================================== --- openpcl/src/com/openpcl/pclrenderimage/render/PriDecompressPclBytes.java 2008-10-17 15:56:51 UTC (rev 221) +++ openpcl/src/com/openpcl/pclrenderimage/render/PriDecompressPclBytes.java 2008-10-17 15:59:12 UTC (rev 222) @@ -96,12 +96,14 @@ while (dataCount-- > 0) { int cntrlByte = (int) data[dataStartOffset++]; - + // Repeated pattern int val = data[dataStartOffset++]; dataCount--; - while (cntrlByte-- > 0) + while (cntrlByte >= 0) { decompressed.add(numberOfDecompressedBytes++, new Byte((byte) val)); + cntrlByte--; + } } mMaxUncompressedByteCount = numberOfDecompressedBytes; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <doc...@us...> - 2008-10-17 15:57:00
|
Revision: 221 http://openpcl.svn.sourceforge.net/openpcl/?rev=221&view=rev Author: documentsystems Date: 2008-10-17 15:56:51 +0000 (Fri, 17 Oct 2008) Log Message: ----------- Add support for Vertical/Horizontal decipoint draws in processDrawCommand method. 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:42:51 UTC (rev 220) +++ openpcl/src/com/openpcl/pclrenderimage/PclRenderImage.java 2008-10-17 15:56:51 UTC (rev 221) @@ -589,10 +589,25 @@ * @param cmdTerminator */ private void processMiscACommand(String cmdValue, char cmdTerminator) { + int dpiValue; switch(cmdTerminator){ - case 'R': + case 'H': if (mIsStateBuildingPclPages || mIsRecordingAMacro) { return; } + dpiValue = Integer.parseInt(cmdValue) * 300 / 720; mPriDrawText.drawBufferedUpCharsAs1String(); + mPriCursorPos.xPositionCommand(String.valueOf(dpiValue)); // Set the X + break; +// } else if (cmdCharArray[3] == 'Y') { // *p,Y +// } else if (cmdTerminator.equals("Y")) { // *p,Y + case 'V': + if (mIsStateBuildingPclPages || mIsRecordingAMacro) { return; } + dpiValue = Integer.parseInt(cmdValue) * 300 / 720; + mPriDrawText.drawBufferedUpCharsAs1String(); + mPriCursorPos.yPositionCommand(String.valueOf(dpiValue)); // Set the Y + break; + case 'R': + if (mIsStateBuildingPclPages || mIsRecordingAMacro) { return; } + mPriDrawText.drawBufferedUpCharsAs1String(); // Relative Y positioning by number of rows (+ or - or no sign) mPriCursorPos.relativeYByNumberOfRows(cmdValue); break; @@ -699,50 +714,56 @@ * @param cmdValueInt */ private void processDrawCommand(char cmdTerminator, int cmdValueInt) { + int dpiValue; switch(cmdTerminator){ - case 'A': + case 'A': // Set width in Pcl Units for future rectangle draw (don't draw rectangle yet) - if (mIsStateBuildingPclPages || mIsRecordingAMacro) { return; } - mPriRectDrawing.setPclUnitsWidth(cmdValueInt); - break; - case 'B': - if (mIsStateBuildingPclPages || mIsRecordingAMacro) { return; } - // Set height in Pcl Units for future rectangle draw (don't draw rectangle yet) - mPriRectDrawing.setPclUnitsHeight(cmdValueInt); - break; - case 'D': - if (mIsStateBuildingPclPages || mIsRecordingAMacro) { return; } - mPriParseSoftFontBytes.assignSoftFontId(cmdValueInt); // Assign soft font Id - break; - case 'E': - if (mIsStateBuildingPclPages || mIsRecordingAMacro) { return; } - // Soft font character code for next char download - mPriParseSoftFontBytes.setCharCodeForNextCharDownload(cmdValueInt); - break; - case 'F': - if (mIsStateBuildingPclPages || mIsRecordingAMacro) { return; } - mPriParseSoftFontBytes.fontControlForSoftFonts(cmdValueInt); // Font Control (values are 0 thru 6) - break; - case 'G': - if (mIsStateBuildingPclPages || mIsRecordingAMacro) { return; } - mPriRectDrawing.setPatternIdAreaFill(cmdValueInt); // Pattern Id rectangle draw - break; - case 'H': - // TODO Horizontal rectangle size in Decipoints// TODO Horizontal rectangle size in Decipoints - break; - - case 'P': - if (mIsStateBuildingPclPages) { - mPriPclPage.getPriRenderCounters().bumpNumRectanglesDrawn(); - } else { - mPriDrawText.drawBufferedUpCharsAs1String(); - mPriRectDrawing.drawRectangleCommand(cmdValueInt); - } - break; - case 'V': - // TODO Vertical rectangle size in Decipoints - break; - } + if (mIsStateBuildingPclPages || mIsRecordingAMacro) { return; } + mPriRectDrawing.setPclUnitsWidth(cmdValueInt); + break; + case 'B': + if (mIsStateBuildingPclPages || mIsRecordingAMacro) { return; } + // Set height in Pcl Units for future rectangle draw (don't draw rectangle yet) + mPriRectDrawing.setPclUnitsHeight(cmdValueInt); + break; + case 'D': + if (mIsStateBuildingPclPages || mIsRecordingAMacro) { return; } + mPriParseSoftFontBytes.assignSoftFontId(cmdValueInt); // Assign soft font Id + break; + case 'E': + if (mIsStateBuildingPclPages || mIsRecordingAMacro) { return; } + // Soft font character code for next char download + mPriParseSoftFontBytes.setCharCodeForNextCharDownload(cmdValueInt); + break; + case 'F': + if (mIsStateBuildingPclPages || mIsRecordingAMacro) { return; } + mPriParseSoftFontBytes.fontControlForSoftFonts(cmdValueInt); // Font Control (values are 0 thru 6) + break; + case 'G': + if (mIsStateBuildingPclPages || mIsRecordingAMacro) { return; } + mPriRectDrawing.setPatternIdAreaFill(cmdValueInt); // Pattern Id rectangle draw + break; + case 'H': + // Horizontal rectangle size in Decipoints + if (mIsStateBuildingPclPages || mIsRecordingAMacro) { return; } + dpiValue = cmdValueInt * 300 / 720; + mPriRectDrawing.setPclUnitsWidth(dpiValue); + break; + case 'P': + if (mIsStateBuildingPclPages) { + mPriPclPage.getPriRenderCounters().bumpNumRectanglesDrawn(); + } else { + mPriDrawText.drawBufferedUpCharsAs1String(); + mPriRectDrawing.drawRectangleCommand(cmdValueInt); + } + break; + case 'V': + // Vertical rectangle size in Decipoints + if (mIsStateBuildingPclPages || mIsRecordingAMacro) { return; } + dpiValue = cmdValueInt * 300 / 720; + mPriRectDrawing.setPclUnitsHeight(dpiValue); + break; + } } private void processPositionCommand(String cmdValue, char cmdTerminator) { 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. |
From: <doc...@us...> - 2008-03-31 20:40:43
|
Revision: 219 http://openpcl.svn.sourceforge.net/openpcl/?rev=219&view=rev Author: documentsystems Date: 2008-03-31 13:39:54 -0700 (Mon, 31 Mar 2008) Log Message: ----------- Change horizontal positioning to be based on float values rather than int. Turn off default bolding of fixed-width text. Modified Paths: -------------- openpcl/src/com/openpcl/pclrenderimage/render/PriFonts.java Modified: openpcl/src/com/openpcl/pclrenderimage/render/PriFonts.java =================================================================== --- openpcl/src/com/openpcl/pclrenderimage/render/PriFonts.java 2008-03-31 20:38:11 UTC (rev 218) +++ openpcl/src/com/openpcl/pclrenderimage/render/PriFonts.java 2008-03-31 20:39:54 UTC (rev 219) @@ -32,10 +32,10 @@ protected ArrayList<int[]> mCharWidthArrayList = null; // For mono fonts, number of characters per inch = (s#H - protected int mCurrentHorizontalPitch = 10; + protected float mCurrentHorizontalPitch = 10; // For mono fonts not proportional fonts, (cpi = 120 / HMI). = &k#H - protected int mCurrentHorizontalMotionIndexHMI = 12; + protected float mCurrentHorizontalMotionIndexHMI = 12; protected int mCurrentFontStylePlanBoldItalic = Font.PLAIN; protected float mCurrentFontHeight = 12; @@ -170,7 +170,7 @@ public FontRenderContext getFontRenderContext() { return mFontRenderContext; } public int getCurrentFontStylePlanBoldItalic() { return mCurrentFontStylePlanBoldItalic; } public boolean getIsMonospacedFont() { return mCurrentJavaBuiltInFont == sFontIsMonospaced; } - public int getCurrentHorizontalPitch() { return mCurrentHorizontalPitch; } + public float getCurrentHorizontalPitch() { return mCurrentHorizontalPitch; } /** Get the adjusted pixel width of the character in the current font by using the internal printer font * character width tables. @@ -183,7 +183,7 @@ if (mCurrentJavaBuiltInFont == sFontIsMonospaced) { // To see how HMI works, see the comment block in setHorizontalMotionIndexHMI() - int charsPerInchUsingHMI = 120 / mCurrentHorizontalMotionIndexHMI; + float charsPerInchUsingHMI = 120 / mCurrentHorizontalMotionIndexHMI; // Mono font is selected. Use the current setting for "(dots per inch) / (chars per inch using HMI)" tNumWidthPixels = Math.round((float)PriPageSettings.sPrintDotsPerInch / (float)charsPerInchUsingHMI); } else { @@ -453,7 +453,7 @@ * * @param pHmiValue */ - public void setHorizontalMotionIndexHMI(int pHmiValue) { + public void setHorizontalMotionIndexHMI(float pHmiValue) { mCurrentHorizontalMotionIndexHMI = pHmiValue; mCurrentHorizontalPitch = (120 / mCurrentHorizontalMotionIndexHMI); // PriDebug.infoln(PriDebug.spacesForPclParseMsgs + @@ -532,7 +532,7 @@ switch (mCurrentJavaBuiltInFont) { case sFontIsMonospaced: - makeTextBeBold |= Font.BOLD; + // makeTextBeBold |= Font.BOLD; setMonospacedJavaBuiltInFont(makeTextBeBold, zoomFontHeight); break; case sFontIsSansSerif: 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:38:10
|
Revision: 218 http://openpcl.svn.sourceforge.net/openpcl/?rev=218&view=rev Author: documentsystems Date: 2008-03-31 13:38:11 -0700 (Mon, 31 Mar 2008) Log Message: ----------- Change argument type from int to float in relativeXPosition method. Modified Paths: -------------- openpcl/src/com/openpcl/pclrenderimage/render/PriCursorPos.java Modified: openpcl/src/com/openpcl/pclrenderimage/render/PriCursorPos.java =================================================================== --- openpcl/src/com/openpcl/pclrenderimage/render/PriCursorPos.java 2008-03-31 20:35:46 UTC (rev 217) +++ openpcl/src/com/openpcl/pclrenderimage/render/PriCursorPos.java 2008-03-31 20:38:11 UTC (rev 218) @@ -115,7 +115,7 @@ } /** The relative X position command. Position the drawing point at + X */ - public void relativeXPosition(int xPos) { + public void relativeXPosition(float xPos) { mXpos += xPos; // both a positive or negative add is OK // Debug window info line // PriDebug.infoln(PriDebug.spacesForPclParseMsgs + "PriCursorPos x relative move of " + xPos + 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:36:40
|
Revision: 217 http://openpcl.svn.sourceforge.net/openpcl/?rev=217&view=rev Author: documentsystems Date: 2008-03-31 13:35:46 -0700 (Mon, 31 Mar 2008) Log Message: ----------- Change printer font width (mNumWidthPixelsInternalPrinterFont) from int to float for more precision. Modified Paths: -------------- openpcl/src/com/openpcl/pclrenderimage/render/PriDrawText.java Modified: openpcl/src/com/openpcl/pclrenderimage/render/PriDrawText.java =================================================================== --- openpcl/src/com/openpcl/pclrenderimage/render/PriDrawText.java 2008-03-31 20:24:56 UTC (rev 216) +++ openpcl/src/com/openpcl/pclrenderimage/render/PriDrawText.java 2008-03-31 20:35:46 UTC (rev 217) @@ -29,7 +29,7 @@ protected PclRenderImage mPclRenderImage = null; protected Graphics2D mGraphics2D =null; protected int mSelectedSoftFontId = 0; - protected int mNumWidthPixelsInternalPrinterFont = 0; + protected float mNumWidthPixelsInternalPrinterFont = 0; protected PriPclContext mPriPclContext = null; protected PriFontManager mPriFontManager = null; protected PriFontBase mPriFontBase = null; 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:24:56
|
Revision: 216 http://openpcl.svn.sourceforge.net/openpcl/?rev=216&view=rev Author: documentsystems Date: 2008-03-31 13:24:56 -0700 (Mon, 31 Mar 2008) Log Message: ----------- Modified Paths: -------------- openpcl/build.xml Modified: openpcl/build.xml =================================================================== --- openpcl/build.xml 2008-02-19 18:42:03 UTC (rev 215) +++ openpcl/build.xml 2008-03-31 20:24:56 UTC (rev 216) @@ -2,7 +2,6 @@ <project name="OpenPCL" default="all" basedir="."> <description>OpenPCL Build</description> - <property environment="env"/> <property name="project.name" value="openpcl"/> <property name="lib.dir" value="${basedir}/lib"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <doc...@us...> - 2008-02-19 18:42:06
|
Revision: 215 http://openpcl.svn.sourceforge.net/openpcl/?rev=215&view=rev Author: documentsystems Date: 2008-02-19 10:42:03 -0800 (Tue, 19 Feb 2008) Log Message: ----------- Eliminated second parse of PCL for a consistent performance. Limited the number of objects created to improve performance by eliminating excessive garbage collection. Modified Paths: -------------- openpcl/src/com/openpcl/pclrenderimage/PclRenderImage.java openpcl/src/com/openpcl/pclrenderimage/macro/PriParseMacroBytes.java openpcl/src/com/openpcl/pclrenderimage/render/PriDecompressPclBytes.java openpcl/src/com/openpcl/pclrenderimage/render/PriFonts.java openpcl/src/com/openpcl/pclrenderimage/tools/PclCommandEvent.java openpcl/src/com/openpcl/pclrenderimage/tools/PclParser.java openpcl/src/com/openpcl/pclrenderimage/util/PriModifyPclBytes.java Modified: openpcl/src/com/openpcl/pclrenderimage/PclRenderImage.java =================================================================== --- openpcl/src/com/openpcl/pclrenderimage/PclRenderImage.java 2007-12-07 23:12:58 UTC (rev 214) +++ openpcl/src/com/openpcl/pclrenderimage/PclRenderImage.java 2008-02-19 18:42:03 UTC (rev 215) @@ -25,8 +25,8 @@ import com.openpcl.pclrenderimage.tools.PclCommandEvent; import com.openpcl.pclrenderimage.tools.PclParser; -//import com.openpcl.pclrenderimage.util.PriDebug; + /** * 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 @@ -52,8 +52,38 @@ * @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 + private static final String PCL_RESET = "E"; +private static final String PCL_PRIMARY_FONT = "("; + +private static final String PCL_SOFT_FONT = "(s"; + +private static final String PCL_SECONDARY_FONT = ")s"; + +private static final String PCL_UNIT = "&u"; + +private static final String PCL_MISC_K = "&k"; + +private static final String PCL_EXECUTE = "&f"; + +private static final String PCL_MISC_L = "&l"; + +private static final String PCL_MISC_A = "&a"; + +private static final String PCL_DRAW_RASTER_MISC = "*t"; + +private static final String PCL_SHADING_TRANSPARENCY = "*v"; + +private static final String PCL_DRAW_RASTER = "*r"; + +private static final String PCL_DRAW_RASTER_CONFIG = "*b"; + +private static final String PCL_DRAW = "*c"; + +private static final String PCL_POSITION = "*p"; + +protected PclParser mPclParser = null; // PclParser in RmsTools + // Each open view on the screen will have it's own BufferedImage and mPagesArrayList protected BufferedImage mBufferedImageToDrawOn = null; protected Graphics2D mGraphics2D = null; @@ -89,7 +119,6 @@ protected long mThreadIdCounter = 0; protected long mCurrentThreadId = 0; protected boolean mIsSoftFontMode = false; - protected boolean mParsePclIs1stPass = false; protected boolean mIsRecordingAMacro = false; protected boolean mIsExecutingAMacro = false; protected boolean mIsDrawingForPrinting = false; @@ -142,7 +171,6 @@ public int getMultipleOpenId() { return mMultipleOpenId; } public double getCurrentZoomFactor() { return mCurrentZoomFactor; } public boolean getIsSoftFontMode() { return mIsSoftFontMode; } - public boolean getParsePclIs1stPass() { return mParsePclIs1stPass; } public boolean getIsDrawingForPrinting() { return mIsDrawingForPrinting; } public boolean getIsStateBuildingPclPages() { return mIsStateBuildingPclPages; } public boolean getWantToCenterCharInCharCellBox() { return mWantToCenterCharInCharCellBox; } @@ -152,7 +180,6 @@ // Setters public void setCurrentClickedPagePclBytes(byte[] pByteArray) { mCurrentClickedPagePclBytes = pByteArray; } - public void setParsePclIs1stPass(boolean pParsePclIs1stPass) { mParsePclIs1stPass = pParsePclIs1stPass; } public void setIsDrawingForPrinting(boolean pIsDrawingForPrinting) { mIsDrawingForPrinting = pIsDrawingForPrinting; } public void setWantToCenterCharInCharCellBox(boolean pWantToCenterCharInCharCellBox) { @@ -162,11 +189,6 @@ public void setCurrentZoomFactor(double pCurrentZoomFactor) { mCurrentZoomFactor = pCurrentZoomFactor; } protected void handleFormFeedFound(int pBufferPos) { - - // Return if this is parse pass 1 because only rectangle drawing is done on pass 1, and form feeds will be handled - // during parse pass 2. - if (mParsePclIs1stPass) {return;} - // Return if the Pcl bytes have already been split into separate PriPclPage objects // Now if there's still a Form Feed in each Page's PCL then ignore the Form Feed, so return here if ( !mIsStateBuildingPclPages) { return; } @@ -195,9 +217,6 @@ } public void charFoundEvent(char nextChar, int pBufferPos) { - // Debug window info line - //System.out.println("char: " + nextChar + " at " + pBufferPos); - if (nextChar == scFF) { // form feed mPriDrawText.drawBufferedUpCharsAs1String(); handleFormFeedFound(pBufferPos); @@ -215,8 +234,6 @@ mPriCursorPos.relativeYPosition(mPriPageSettings.getNumPixelsPerLine()); } - // Only rectangle drawing is done on pass 1 - if (mParsePclIs1stPass) {return;} // Skip bytes when the start macro command has been encountered and didn't get stop macro yet if (mIsRecordingAMacro) { return; } @@ -238,7 +255,7 @@ } public void commandFoundEvent( - String cmdLeadin, String cmdValue, String cmdTerminator, byte[] cmdData, int pBufferPos) { + String cmdLeadin, String cmdValue, char cmdTerminator, byte[] cmdData, int pBufferPos) { // If another zoom has started while drawing, then abort this zoom if (mCurrentThreadId < mThreadIdCounter) { return; } @@ -246,231 +263,264 @@ // Debug window info line //System.out.println("cmd: " + cmdLeadin + cmdValue + cmdTerminator + " at " + pBufferPos); - String pclCmd = cmdLeadin + "," + cmdTerminator; int cmdValueInt = 0; float cmdValueFloat = 0.0f; - try { - // Use Float.parseFloat() then Math.round() because when cmdValue is "10.00", - // Interger.parseInt() returns 0 instead of 10 - cmdValueFloat = Float.parseFloat(cmdValue); - cmdValueInt = Math.round(cmdValueFloat); - } catch (NumberFormatException e) { + /* + * 13.Feb.2008 DocMagic, Document Systems Inc, Jay Peterson: + * cmdValue now null tolerant, caused excessive object creation which forced GC + */ + try { + // The command value is null for some commands, a parseFloat will throw an exception under this condition + if(cmdValue != null){ + // Use Float.parseFloat() then Math.round() because when cmdValue is "10.00", + // Interger.parseInt() returns 0 instead of 10 + cmdValueFloat = Float.parseFloat(cmdValue); + cmdValueInt = Math.round(cmdValueFloat); + } + } catch (NumberFormatException e) { + } + // The "if else" is nested for parse speed instead of a 1 level long string compare chain. + // The most frequently used commands should be nearer the top. + if(cmdLeadin.equals(PCL_POSITION)){ // Position command + processPositionCommand(cmdValue, cmdTerminator); + } else if(cmdLeadin.equals(PCL_DRAW)){ // Draw command + processDrawCommand(cmdTerminator, cmdValueInt); + } else if(cmdLeadin.equals(PCL_DRAW_RASTER_CONFIG)) { // Raster draw command + processDrawRasterConfigCommand(cmdTerminator, cmdData, cmdValueInt); + } else if(cmdLeadin.equals(PCL_DRAW_RASTER)){ + processDrawRasterCommand(cmdTerminator, cmdValueInt); + } else if(cmdLeadin.equals(PCL_SHADING_TRANSPARENCY)){ + processShadeTransparencyCommand(cmdTerminator, cmdValueInt); + } else if (cmdLeadin.equals(PCL_DRAW_RASTER_MISC)) { + processDrawRasterMiscCommand(cmdTerminator, cmdValueInt); + } else if (cmdLeadin.equals(PCL_MISC_A)) { + processMiscACommand(cmdValue, cmdTerminator); + } else if (cmdLeadin.equals(PCL_MISC_L)) { + processMiscLCommand(cmdTerminator, cmdValueInt); + } else if (cmdLeadin.equals(PCL_EXECUTE)) { + processExecuteCommand(cmdTerminator, pBufferPos, cmdValueInt); + } else if (cmdLeadin.equals(PCL_MISC_K)) { + processMiscKCommand(cmdTerminator, cmdValueInt); + } else if (cmdLeadin.equals(PCL_UNIT)) { + processUnitCommand(cmdTerminator, cmdValueInt); + } else if (cmdLeadin.equals(PCL_SECONDARY_FONT)) { + processSecondaryFontCommand(cmdTerminator, cmdData, cmdValueInt); + } else if (cmdLeadin.equals(PCL_SOFT_FONT)) { + processSoftFontCommand(cmdValue, cmdTerminator, cmdData, cmdValueInt, cmdValueFloat); + } else if (cmdLeadin.equals(PCL_PRIMARY_FONT)) { + processPrimaryFontCommand(cmdTerminator, cmdValueInt); + } else if (cmdLeadin.equals(PCL_RESET)) { + processResetCommand(); + } + } + +private void processResetCommand() { + // Skip bytes when the start macro command has been encountered and didn't get stop macro yet + if (mIsStateBuildingPclPages || mIsRecordingAMacro) { return; } + mPriDrawText.drawBufferedUpCharsAs1String(); +} + +/** + * @param cmdTerminator + * @param cmdValueInt + */ +private void processPrimaryFontCommand(char cmdTerminator, int cmdValueInt) { + if (mIsStateBuildingPclPages || mIsRecordingAMacro) { return; } + switch(cmdTerminator){ + case 'U': // (,U + mPriDrawText.drawBufferedUpCharsAs1String(); + mPriFonts.setSymbolSetGroupU(cmdValueInt); + break; + case 'X': // (,X + mPriDrawText.drawBufferedUpCharsAs1String(); + mIsSoftFontMode = true; + // Select the specified soft font as the current primary font + mPriParseSoftFontBytes.selectSoftFontById(cmdValueInt); + break; + // (,<AllUnsuportedSymbolSets> + case 'D': + case 'E': + case 'F': + case 'G': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'S': + case 'T': + mPriFonts.setSymbolSetIsUnsupported(cmdValueInt, cmdTerminator); + break; + default: // only for syntax completeness + break; } - - // Put into char array to not do a lot of String.substring() commands later - char[] cmdCharArray = pclCmd.toCharArray(); - - // The "if else" is nested for parse speed instead of a 1 level long string compare chain. - // The most frequently used commands should be nearer the top. - if (cmdCharArray[0] == '*') { // * - if (cmdCharArray[1] == 'p') { // *p - if (cmdCharArray[2] == ',') { - if (cmdCharArray[3] == 'X') { // *p,X - if (mIsStateBuildingPclPages || mIsRecordingAMacro) { return; } - mPriDrawText.drawBufferedUpCharsAs1String(); - mPriCursorPos.xPositionCommand(cmdValue); // Set the X - } else if (cmdCharArray[3] == 'Y') { // *p,Y - if (mIsStateBuildingPclPages || mIsRecordingAMacro) { return; } - mPriDrawText.drawBufferedUpCharsAs1String(); - mPriCursorPos.yPositionCommand(cmdValue); // Set the Y +} + +/** + * @param cmdValue + * @param cmdTerminator + * @param cmdData + * @param cmdValueInt + * @param cmdValueFloat + */ +private void processSoftFontCommand(String cmdValue, char cmdTerminator, byte[] cmdData, int cmdValueInt, float cmdValueFloat) { + switch(cmdTerminator){ + case 'B': + if (mIsStateBuildingPclPages || mIsRecordingAMacro) {return;} + mPriDrawText.drawBufferedUpCharsAs1String(); + mPriFonts.setFontStrokeWeight(cmdValueInt); + break; + case 'H': + if (mIsStateBuildingPclPages || mIsRecordingAMacro) {return;} + mPriDrawText.drawBufferedUpCharsAs1String(); + mPriFonts.setFontHorizontalPitch(cmdValueInt); + break; + case 'S': + if (mIsStateBuildingPclPages || mIsRecordingAMacro) {return;} + mPriDrawText.drawBufferedUpCharsAs1String(); + mPriFonts.setFontItalicOrCondensedStyle(cmdValueInt); + break; + case 'T': + if (mIsStateBuildingPclPages || mIsRecordingAMacro) {return;} + mPriDrawText.drawBufferedUpCharsAs1String(); + mIsSoftFontMode = false; + mPriFonts.setFontIsPrimary(); + mPriFonts.setJavaBuiltInFont(cmdValueInt); + break; + case 'V': + if (mIsStateBuildingPclPages || mIsRecordingAMacro) {return;} + mPriDrawText.drawBufferedUpCharsAs1String(); + mPriFonts.setFontHeight(cmdValueFloat); // Pass the float instead of the int because some PCL has for example 7.5 + break; + case 'W': + if (mIsStateBuildingPclPages || mIsRecordingAMacro) {return;} + // Transfer soft font per character data bytes + mPriParseSoftFontBytes.transferSoftFontPerCharacterData(cmdValueInt, cmdData); + break; + case 'Z': + if (mIsRecordingAMacro) { return; } + // Call the below to see if this is a signature block for both mIsStateBuildingPclPages is true or false + // because the called method finds out if this Z command is a signature block or not + // and returns true if a signature block was drawn, and if so, then only if building Pcl pages bump its + // counter + if (mPriRectDrawing.dsiZcommand(cmdValue)) { + if (mIsStateBuildingPclPages) { + mPriPclPage.getPriRenderCounters().bumpNumSignatureBlocksDrawn(); } } - } else if (cmdCharArray[1] == 'c') { // *c - if (cmdCharArray[2] == ',') { - if (cmdCharArray[3] == 'A') { // *c,A - // Set width in Pcl Units for future rectangle draw (don't draw rectangle yet) + break; + } +} + +/** + * @param cmdTerminator + * @param cmdData + * @param cmdValueInt + */ +private void processSecondaryFontCommand(char cmdTerminator, byte[] cmdData, int cmdValueInt) { + switch(cmdTerminator){ + case 'W': + if (mIsStateBuildingPclPages || mIsRecordingAMacro) { return; } + mPriDrawText.drawBufferedUpCharsAs1String(); + // Transfer soft font header data bytes + mPriParseSoftFontBytes.transferSoftFontHeaderData(cmdValueInt, cmdData); + break; + case 'T': + if (mIsStateBuildingPclPages || mIsRecordingAMacro) {return;} + mPriDrawText.drawBufferedUpCharsAs1String(); + mIsSoftFontMode = false; + mPriFonts.setFontIsSecondary(); + mPriFonts.setJavaBuiltInFont(cmdValueInt); + break; + } +} + +/** + * @param cmdTerminator + * @param cmdValueInt + */ +private void processUnitCommand(char cmdTerminator, int cmdValueInt) { + switch(cmdTerminator){ + case 'D': if (mIsStateBuildingPclPages || mIsRecordingAMacro) { return; } - mPriRectDrawing.setPclUnitsWidth(cmdValueInt); - } else if (cmdCharArray[3] == 'B') { // *c,B - if (mIsStateBuildingPclPages || mIsRecordingAMacro) { return; } - // Set height in Pcl Units for future rectangle draw (don't draw rectangle yet) - mPriRectDrawing.setPclUnitsHeight(cmdValueInt); - } else if (cmdCharArray[3] == 'D') { // *c,D - if (mParsePclIs1stPass || mIsStateBuildingPclPages || mIsRecordingAMacro) { return; } - mPriParseSoftFontBytes.assignSoftFontId(cmdValueInt); // Assign soft font Id - } else if (cmdCharArray[3] == 'E') { // *c,E - if (mParsePclIs1stPass || mIsStateBuildingPclPages || mIsRecordingAMacro) { return; } - // Soft font character code for next char download - mPriParseSoftFontBytes.setCharCodeForNextCharDownload(cmdValueInt); - } else if (cmdCharArray[3] == 'F') { // *c,F - if (mParsePclIs1stPass || mIsStateBuildingPclPages || mIsRecordingAMacro) { return; } - mPriParseSoftFontBytes.fontControlForSoftFonts(cmdValueInt); // Font Control (values are 0 thru 6) - } else if (cmdCharArray[3] == 'G') { // *c,G - if (mIsStateBuildingPclPages || mIsRecordingAMacro) { return; } - if (mParsePclIs1stPass) { - mPriRectDrawing.setPatternIdAreaFill(cmdValueInt); // Pattern Id rectangle draw - } - } else if (cmdCharArray[3] == 'H') { // *c,H - // TODO Horizontal rectangle size in Decipoints - } else if (cmdCharArray[3] == 'P') { // *c,P - if (mParsePclIs1stPass) { - if (mIsStateBuildingPclPages) { - mPriPclPage.getPriRenderCounters().bumpNumRectanglesDrawn(); - } else { - mPriDrawText.drawBufferedUpCharsAs1String(); - mPriRectDrawing.drawRectangleCommand(cmdValueInt); - } - } // Draw rectangle - } else if (cmdCharArray[3] == 'V') { // *c,V - // TODO Vertical rectangle size in Decipoints - } - } - } else if (cmdCharArray[1] == 'b') { // *b - if (cmdCharArray[2] == ',') { - if (cmdCharArray[3] == 'M') { // *b,M - if (mParsePclIs1stPass || mIsStateBuildingPclPages || mIsRecordingAMacro) {return;} - mPriRasterDrawing.setRasterCompressionMethod(cmdValueInt); // Raster compression mode - } else if (cmdCharArray[3] == 'W') { // *b,W - if (mParsePclIs1stPass || mIsRecordingAMacro) {return;} - if (mIsStateBuildingPclPages) { - mPriPclPage.getPriRenderCounters().bumpNumRasterRowsDrawn(); - } else { - mPriRasterDrawing.transferRasterData(cmdValueInt, cmdData); // Transfer raster data - } - } else if (cmdCharArray[3] == 'Y') { // *b,Y - if (mParsePclIs1stPass || mIsStateBuildingPclPages || mIsRecordingAMacro) {return;} - mPriRasterDrawing.setRasterYoffset(cmdValueInt); // Raster Y Offset - } - } - } else if (cmdCharArray[1] == 'r') { // *r - if (cmdCharArray[2] == ',') { - if (cmdCharArray[3] == 'A') { // *r,A - if (mParsePclIs1stPass || mIsStateBuildingPclPages || mIsRecordingAMacro) {return;} mPriDrawText.drawBufferedUpCharsAs1String(); - mPriRasterDrawing.setStartRasterGraphics(cmdValueInt); // Start raster graphics. Values 0 and 1 only - } else if (cmdCharArray[3] == 'B') { // *r,B - if (mParsePclIs1stPass || mIsStateBuildingPclPages || mIsRecordingAMacro) {return;} - mPriRasterDrawing.setEndRasterGraphics(); // End raster graphics is supported by HPLaserJetIII. - } else if (cmdCharArray[3] == 'C') { // *r,C - if (mParsePclIs1stPass || mIsStateBuildingPclPages || mIsRecordingAMacro) {return;} - mPriRasterDrawing.setEndRasterGraphics(); // End raster graphics not supported by HPLaserJetIII. - } else if (cmdCharArray[3] == 'F' ) { // *r,F - if (mParsePclIs1stPass || mIsStateBuildingPclPages || mIsRecordingAMacro) {return;} - // Presentation Mode Direction. Values 0 and 3 only - mPriDrawText.drawBufferedUpCharsAs1String(); - mPriRasterDrawing.setPresentationModeDirection(cmdValueInt); - } else if (cmdCharArray[3] == 'S' ) { // *r,S - if (mParsePclIs1stPass || mIsStateBuildingPclPages || mIsRecordingAMacro) {return;} - mPriRasterDrawing.setRasterWidth(cmdValueInt); // Raster Width - } else if (cmdCharArray[3] == 'T' ) { // *r,T - if (mParsePclIs1stPass || mIsStateBuildingPclPages || mIsRecordingAMacro) {return;} - mPriRasterDrawing.setRasterHeight(cmdValueInt); // Raster Height - } - } - } 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 - // TODO Source Transparency Mode - } else if (cmdCharArray[3] == 'O') { // *v,O - // TODO Pattern Transparency Mode - } - } - } else if (cmdCharArray[1] == 't') { // *t - if (cmdCharArray[2] == ',') { - if (cmdCharArray[3] == 'R') { // *t,R - if (mParsePclIs1stPass || mIsStateBuildingPclPages || mIsRecordingAMacro) {return;} - mPriRasterDrawing.setRasterGraphicsResolution(cmdValueInt); // Set Raster Graphics Resolution - } - } + mPriPageSettings.setUnitOfMeasure(cmdValueInt); + break; } - } else if (cmdCharArray[0] =='&') { // & - if (cmdCharArray[1] == 'a') { // &a - if (cmdCharArray[2] == ',') { - if (cmdCharArray[3] == 'R') { //&a,R +} + +/** + * @param cmdTerminator + * @param cmdValueInt + */ +private void processMiscKCommand(char cmdTerminator, int cmdValueInt) { + switch(cmdTerminator){ + case 'H': if (mIsStateBuildingPclPages || mIsRecordingAMacro) { return; } mPriDrawText.drawBufferedUpCharsAs1String(); - // Relative Y positioning by number of rows (+ or - or no sign) - mPriCursorPos.relativeYByNumberOfRows(cmdValue); - } - } - } else if (cmdCharArray[1] == 'l') { // &l - if (cmdCharArray[2] == ',') { - if (cmdCharArray[3] == 'A') { //&l,A + mPriFonts.setHorizontalMotionIndexHMI(cmdValueInt); + break; + } +} + +/** + * @param cmdTerminator + * @param pBufferPos + * @param cmdValueInt + */ +private void processExecuteCommand(char cmdTerminator, int pBufferPos, int cmdValueInt) { + switch(cmdTerminator){ + case 'Y': + if (mIsStateBuildingPclPages) { return; } mPriDrawText.drawBufferedUpCharsAs1String(); - mPriPageSettings.setPaperSize(cmdValueInt); // Paper Size 1=Executive, 2=Letter, 3=Legal, 6=Ledger, 26=A4, 27=A3 - } else if (cmdCharArray[3] == 'C') { //&l,C - if (mIsStateBuildingPclPages || mIsRecordingAMacro) {return;} - mPriDrawText.drawBufferedUpCharsAs1String(); - mPriPageSettings.setVerticalMotionIndex(cmdValueInt); // LPI Vertical Motion Index is 48 / # - } else if (cmdCharArray[3] == 'D') { //&l,D - if (mIsStateBuildingPclPages || mIsRecordingAMacro) {return;} - mPriDrawText.drawBufferedUpCharsAs1String(); - // LPI Line Spacing is thisValue VMI which is the number of vertical lines for 1 inch - mPriPageSettings.setLineSpacing(cmdValueInt); - } else if (cmdCharArray[3] == 'E') { //&l,E - if (mIsStateBuildingPclPages || mIsRecordingAMacro) {return;} - mPriDrawText.drawBufferedUpCharsAs1String(); - // Top Margin adjustment is (dpi / VMI) * thisValue - mPriPageSettings.setTopMarginAdjustment(cmdValueInt); - } else if (cmdCharArray[3] == 'H') { //&l,H - // TODO Paper Source - } else if (cmdCharArray[3] == 'L') { //&l,L - // TODO Perforation skip - } else if (cmdCharArray[3] == 'O') { //&l,O - // TODO Page orientation Portrait or Landscape - } else if (cmdCharArray[3] == 'S') { //&l,S - // 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 - } - } - } else if (cmdCharArray[1] == 'f') { //&f - if (cmdCharArray[2] == ',') { - if (cmdCharArray[3] == 'Y') { //&f,Y - if (mParsePclIs1stPass || mIsStateBuildingPclPages) { return; } - mPriDrawText.drawBufferedUpCharsAs1String(); mPriParseMacroBytes.setCurrentMacroId(cmdValueInt); // Set Macro ID for later definition or execution - } else if (cmdCharArray[3] == 'X') { //&f,X - if (mParsePclIs1stPass) { return; } + break; + case 'X': switch (cmdValueInt) { - case 0: // &f0X - if (mIsStateBuildingPclPages) { return; } - mIsRecordingAMacro = true; - mPriParseMacroBytes.startMacroDefinition(pBufferPos); - break; - case 1: // &f1X - if (mIsStateBuildingPclPages) { return; } - mPriParseMacroBytes.stopMacroDefinition(pBufferPos, mCurrentClickedPagePclBytes); - mIsRecordingAMacro = false; - break; - case 2: // &f2X - if (mIsStateBuildingPclPages) { - mPriPclPage.getPriRenderCounters().bumpNumMacrosExecuted(); - } else { - mIsExecutingAMacro = true; - mPriParseMacroBytes.executeMacro(); - mIsExecutingAMacro = false; + case 0: // &f0X + if (mIsStateBuildingPclPages) { return; } + mIsRecordingAMacro = true; + mPriParseMacroBytes.startMacroDefinition(pBufferPos); + break; + case 1: // &f1X + if (mIsStateBuildingPclPages) { return; } + mPriParseMacroBytes.stopMacroDefinition(pBufferPos, mCurrentClickedPagePclBytes); mIsRecordingAMacro = false; - } - break; - case 3: // &f3X - if (mIsStateBuildingPclPages) { return; } - mPriParseMacroBytes.saveFullStateThenCallMacro(); - mIsRecordingAMacro = false; - break; - case 4: // &f4X - if (mIsStateBuildingPclPages) { return; } - mPriParseMacroBytes.saveFullStateThenOverlayMacro(); - mIsRecordingAMacro = false; - break; - case 5: // &f5X - if (mIsStateBuildingPclPages) { return; } - mPriParseMacroBytes.disableAutomaticOverlay(); - break; - case 6: // &f6X - if (mIsStateBuildingPclPages) { return; } - mPriParseMacroBytes.deleteAllMacros(); - break; - case 7: // &f7X - if (mIsStateBuildingPclPages) { return; } - mPriParseMacroBytes.deleteAllTemporaryMacros(); - break; + break; + case 2: // &f2X + if (mIsStateBuildingPclPages) { + mPriPclPage.getPriRenderCounters().bumpNumMacrosExecuted(); + } else { + mIsExecutingAMacro = true; + mPriParseMacroBytes.executeMacro(); + mIsExecutingAMacro = false; + mIsRecordingAMacro = false; + } + break; + case 3: // &f3X + if (mIsStateBuildingPclPages) { return; } + mPriParseMacroBytes.saveFullStateThenCallMacro(); + mIsRecordingAMacro = false; + break; + case 4: // &f4X + if (mIsStateBuildingPclPages) { return; } + mPriParseMacroBytes.saveFullStateThenOverlayMacro(); + mIsRecordingAMacro = false; + break; + case 5: // &f5X + if (mIsStateBuildingPclPages) { return; } + mPriParseMacroBytes.disableAutomaticOverlay(); + break; + case 6: // &f6X + if (mIsStateBuildingPclPages) { return; } + mPriParseMacroBytes.deleteAllMacros(); + break; + case 7: // &f7X + if (mIsStateBuildingPclPages) { return; } + mPriParseMacroBytes.deleteAllTemporaryMacros(); + break; case 8: // &f8X if (mIsStateBuildingPclPages) { return; } mPriParseMacroBytes.deleteLastIdMacro(); @@ -484,128 +534,234 @@ mPriParseMacroBytes.makeMacroPermanent(); break; } - } - } - } else if (cmdCharArray[1] == 'k') { //&k - if (cmdCharArray[2] == ',') { - if (cmdCharArray[3] == 'H') { //&k,H - if (mIsStateBuildingPclPages || mIsRecordingAMacro) { return; } + break; + } +} + +/** + * @param cmdTerminator + * @param cmdValueInt + */ +private void processMiscLCommand(char cmdTerminator, int cmdValueInt) { + switch(cmdTerminator){ + case 'A': mPriDrawText.drawBufferedUpCharsAs1String(); - mPriFonts.setHorizontalMotionIndexHMI(cmdValueInt); - } - } - } else if (cmdCharArray[1] == 'u') { //&u - if (cmdCharArray[2] == ',') { - if (cmdCharArray[3] == 'D') { //&u,D - if (mIsStateBuildingPclPages || mIsRecordingAMacro) { return; } + mPriPageSettings.setPaperSize(cmdValueInt); // Paper Size 1=Executive, 2=Letter, 3=Legal, 6=Ledger, 26=A4, 27=A3 + break; + case 'C': + if (mIsStateBuildingPclPages || mIsRecordingAMacro) {return;} mPriDrawText.drawBufferedUpCharsAs1String(); - mPriPageSettings.setUnitOfMeasure(cmdValueInt); - } - } - } - } else if (cmdCharArray[0] == ')') { // ) - if (cmdCharArray[1] == 's') { // )s - if (cmdCharArray[2] == ',') { - if (cmdCharArray[3] == 'W') { // )s,W - if (mParsePclIs1stPass || mIsStateBuildingPclPages || mIsRecordingAMacro) { return; } + mPriPageSettings.setVerticalMotionIndex(cmdValueInt); // LPI Vertical Motion Index is 48 / # + break; + case 'D': + if (mIsStateBuildingPclPages || mIsRecordingAMacro) {return;} mPriDrawText.drawBufferedUpCharsAs1String(); - // Transfer soft font header data bytes - mPriParseSoftFontBytes.transferSoftFontHeaderData(cmdValueInt, cmdData); - } else if (cmdCharArray[3] == 'T') { // )s,T Set Secondary Font typeface - if (mParsePclIs1stPass || mIsStateBuildingPclPages || mIsRecordingAMacro) {return;} + // LPI Line Spacing is thisValue VMI which is the number of vertical lines for 1 inch + mPriPageSettings.setLineSpacing(cmdValueInt); + break; + case 'E': + if (mIsStateBuildingPclPages || mIsRecordingAMacro) {return;} mPriDrawText.drawBufferedUpCharsAs1String(); - mIsSoftFontMode = false; - mPriFonts.setFontIsSecondary(); - mPriFonts.setJavaBuiltInFont(cmdValueInt); - } - } + // Top Margin adjustment is (dpi / VMI) * thisValue + mPriPageSettings.setTopMarginAdjustment(cmdValueInt); + break; + case 'H': + // TODO Paper Source + break; + case 'L': + // TODO Perforation skip + break; + case 'O': + // TODO Page orientation Portrait or Landscape + break; + case 'S': + // Duplex mode. 0=off (simplex), 1=Duplex on Long Edge of page, 2=Duplex on Short Edge of page + mPriPageSettings.setDuplexMode(cmdValueInt); + break; + case 'X': + // TODO Number of Copies + break; } - } else if (cmdCharArray[0] == '(') { // ( - if (cmdCharArray[1] == 's') { // (s - if (cmdCharArray[2] == ',') { - if (cmdCharArray[3] == 'B') { // (s,B - if (mParsePclIs1stPass || mIsStateBuildingPclPages || mIsRecordingAMacro) {return;} +} + +/** + * @param cmdValue + * @param cmdTerminator + */ +private void processMiscACommand(String cmdValue, char cmdTerminator) { + switch(cmdTerminator){ + case 'R': + if (mIsStateBuildingPclPages || mIsRecordingAMacro) { return; } + mPriDrawText.drawBufferedUpCharsAs1String(); + // Relative Y positioning by number of rows (+ or - or no sign) + mPriCursorPos.relativeYByNumberOfRows(cmdValue); + break; + } +} + +/** + * @param cmdTerminator + * @param cmdValueInt + */ +private void processDrawRasterMiscCommand(char cmdTerminator, int cmdValueInt) { + switch (cmdTerminator) { + case 'R': + if (mIsStateBuildingPclPages || mIsRecordingAMacro) { return; } + mPriRasterDrawing.setRasterGraphicsResolution(cmdValueInt); // Set Raster Graphics Resolution + break; + } +} + +/** + * @param cmdTerminator + * @param cmdValueInt + */ +private void processShadeTransparencyCommand(char cmdTerminator, int cmdValueInt) { + switch(cmdTerminator){ + case 'T': mPriDrawText.drawBufferedUpCharsAs1String(); - mPriFonts.setFontStrokeWeight(cmdValueInt); - } else if (cmdCharArray[3] == 'H') { // (s,H - if (mParsePclIs1stPass || mIsStateBuildingPclPages || mIsRecordingAMacro) {return;} + // Set current Pattern. 0=black, 1=white. White text is put on top of rectangle draws sometimes + mPriPageSettings.setPrintPattern(cmdValueInt); + break; + case 'N': + // TODO Source Transparency Mode + break; + case 'O': + // TODO Pattern Transparency Mode + break; + } +} + +/** + * @param cmdTerminator + * @param cmdValueInt + */ +private void processDrawRasterCommand(char cmdTerminator, int cmdValueInt) { + switch(cmdTerminator){ + case 'A': + if (mIsStateBuildingPclPages || mIsRecordingAMacro) {return;} mPriDrawText.drawBufferedUpCharsAs1String(); - mPriFonts.setFontHorizontalPitch(cmdValueInt); - } else if (cmdCharArray[3] == 'S') { // (s,S - if (mParsePclIs1stPass || mIsStateBuildingPclPages || mIsRecordingAMacro) {return;} + mPriRasterDrawing.setStartRasterGraphics(cmdValueInt); // Start raster graphics. Values 0 and 1 only + break; + case 'B': + if (mIsStateBuildingPclPages || mIsRecordingAMacro) {return;} + mPriRasterDrawing.setEndRasterGraphics(); // End raster graphics is supported by HPLaserJetIII. + break; + case 'C': + if (mIsStateBuildingPclPages || mIsRecordingAMacro) {return;} + mPriRasterDrawing.setEndRasterGraphics(); // End raster graphics not supported by HPLaserJetIII. + break; + case 'F': + if (mIsStateBuildingPclPages || mIsRecordingAMacro) {return;} + // Presentation Mode Direction. Values 0 and 3 only mPriDrawText.drawBufferedUpCharsAs1String(); - mPriFonts.setFontItalicOrCondensedStyle(cmdValueInt); - } else if (cmdCharArray[3] == 'T') { // (s,T Set Primary Font typeface - if (mParsePclIs1stPass || mIsStateBuildingPclPages || mIsRecordingAMacro) {return;} - mPriDrawText.drawBufferedUpCharsAs1String(); - mIsSoftFontMode = false; - mPriFonts.setFontIsPrimary(); - mPriFonts.setJavaBuiltInFont(cmdValueInt); - } else if (cmdCharArray[3] == 'V') { // (s,V - if (mParsePclIs1stPass || mIsStateBuildingPclPages || mIsRecordingAMacro) {return;} - mPriDrawText.drawBufferedUpCharsAs1String(); - mPriFonts.setFontHeight(cmdValueFloat); // Pass the float instead of the int because some PCL has for example 7.5 - } else if (cmdCharArray[3] == 'W') { // (s,W - if (mParsePclIs1stPass || mIsStateBuildingPclPages || mIsRecordingAMacro) {return;} - // Transfer soft font per character data bytes - mPriParseSoftFontBytes.transferSoftFontPerCharacterData(cmdValueInt, cmdData); - } else if (cmdCharArray[3] == 'Z') { // (s,Z - if (mIsRecordingAMacro) { return; } - // Show the below signature block on the image in Parse pass 1 - if (mParsePclIs1stPass) { - // Call the below to see if this is a signature block for both mIsStateBuildingPclPages is true or false - // because the called method finds out if this Z command is a signature block or not - // and returns true if a signature block was drawn, and if so, then only if building Pcl pages bump its - // counter - if (mPriRectDrawing.dsiZcommand(cmdValue)) { - if (mIsStateBuildingPclPages) { - mPriPclPage.getPriRenderCounters().bumpNumSignatureBlocksDrawn(); - } - } - } - } + mPriRasterDrawing.setPresentationModeDirection(cmdValueInt); + break; + case 'S': + if (mIsStateBuildingPclPages || mIsRecordingAMacro) {return;} + mPriRasterDrawing.setRasterWidth(cmdValueInt); // Raster Width + break; + case 'T': + if (mIsStateBuildingPclPages || mIsRecordingAMacro) {return;} + mPriRasterDrawing.setRasterHeight(cmdValueInt); // Raster Height + break; } - } else if (cmdCharArray[1] == ',') { // (, - if (mParsePclIs1stPass || mIsStateBuildingPclPages || mIsRecordingAMacro) { return; } - switch (cmdCharArray[2]) { - case 'U': // (,U - mPriDrawText.drawBufferedUpCharsAs1String(); - mPriFonts.setSymbolSetGroupU(cmdValueInt); +} + +/** + * @param cmdTerminator + * @param cmdData + * @param cmdValueInt + */ +private void processDrawRasterConfigCommand(char cmdTerminator, byte[] cmdData, int cmdValueInt) { + switch(cmdTerminator){ + case 'M': + if (mIsStateBuildingPclPages || mIsRecordingAMacro) {return;} + mPriRasterDrawing.setRasterCompressionMethod(cmdValueInt); // Raster compression mode break; - case 'X': // (,X - mPriDrawText.drawBufferedUpCharsAs1String(); - mIsSoftFontMode = true; - // Select the specified soft font as the current primary font - mPriParseSoftFontBytes.selectSoftFontById(cmdValueInt); + case 'W': + if (mIsRecordingAMacro) {return;} + if (mIsStateBuildingPclPages) { + mPriPclPage.getPriRenderCounters().bumpNumRasterRowsDrawn(); + } else { + mPriRasterDrawing.transferRasterData(cmdValueInt, cmdData); // Transfer raster data + } break; - // (,<AllUnsuportedSymbolSets> + case 'Y': + if (mIsStateBuildingPclPages || mIsRecordingAMacro) {return;} + mPriRasterDrawing.setRasterYoffset(cmdValueInt); // Raster Y Offset + break; + } +} + +/** + * @param cmdTerminator + * @param cmdValueInt + */ +private void processDrawCommand(char cmdTerminator, int cmdValueInt) { + switch(cmdTerminator){ + case 'A': + // Set width in Pcl Units for future rectangle draw (don't draw rectangle yet) + if (mIsStateBuildingPclPages || mIsRecordingAMacro) { return; } + mPriRectDrawing.setPclUnitsWidth(cmdValueInt); + break; + case 'B': + if (mIsStateBuildingPclPages || mIsRecordingAMacro) { return; } + // Set height in Pcl Units for future rectangle draw (don't draw rectangle yet) + mPriRectDrawing.setPclUnitsHeight(cmdValueInt); + break; case 'D': + if (mIsStateBuildingPclPages || mIsRecordingAMacro) { return; } + mPriParseSoftFontBytes.assignSoftFontId(cmdValueInt); // Assign soft font Id + break; case 'E': + if (mIsStateBuildingPclPages || mIsRecordingAMacro) { return; } + // Soft font character code for next char download + mPriParseSoftFontBytes.setCharCodeForNextCharDownload(cmdValueInt); + break; case 'F': + if (mIsStateBuildingPclPages || mIsRecordingAMacro) { return; } + mPriParseSoftFontBytes.fontControlForSoftFonts(cmdValueInt); // Font Control (values are 0 thru 6) + break; case 'G': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'S': - case 'T': - mPriFonts.setSymbolSetIsUnsupported(cmdValueInt, cmdTerminator); + if (mIsStateBuildingPclPages || mIsRecordingAMacro) { return; } + mPriRectDrawing.setPatternIdAreaFill(cmdValueInt); // Pattern Id rectangle draw break; - default: // only for syntax completeness + case 'H': + // TODO Horizontal rectangle size in Decipoints// TODO Horizontal rectangle size in Decipoints break; - } + + case 'P': + if (mIsStateBuildingPclPages) { + mPriPclPage.getPriRenderCounters().bumpNumRectanglesDrawn(); + } else { + mPriDrawText.drawBufferedUpCharsAs1String(); + mPriRectDrawing.drawRectangleCommand(cmdValueInt); + } + break; + case 'V': + // TODO Vertical rectangle size in Decipoints + break; } - } else if (cmdCharArray[0] == 'E') { // E - // Skip bytes when the start macro command has been encountered and didn't get stop macro yet - if (mParsePclIs1stPass || mIsStateBuildingPclPages || mIsRecordingAMacro) { return; } - mPriDrawText.drawBufferedUpCharsAs1String(); - if (cmdCharArray[1] == ',') { // E, Note - the ',' is there at [1], and there is no cmdValue or cmdTerminator - // TODO Reset Command +} + +private void processPositionCommand(String cmdValue, char cmdTerminator) { + switch(cmdTerminator) + { + case 'X': + if (mIsStateBuildingPclPages || mIsRecordingAMacro) { return; } + mPriDrawText.drawBufferedUpCharsAs1String(); + mPriCursorPos.xPositionCommand(cmdValue); // Set the X + break; +// } else if (cmdCharArray[3] == 'Y') { // *p,Y +// } else if (cmdTerminator.equals("Y")) { // *p,Y + case 'Y': + if (mIsStateBuildingPclPages || mIsRecordingAMacro) { return; } + mPriDrawText.drawBufferedUpCharsAs1String(); + mPriCursorPos.yPositionCommand(cmdValue); // Set the Y + break; } - } - } +} /** * Create a new BufferredImage all ready to draw on @@ -747,7 +903,6 @@ // Initialize mode booleans and variables mIsSoftFontMode = false; - mParsePclIs1stPass = false; mIsRecordingAMacro = false; mIsExecutingAMacro = false; @@ -760,33 +915,9 @@ mPriFonts.setJavaBuiltInFont(4099); mPriPageSettings.setToInitialValues(); - //********************************************************************************************* - // Parse pass 1. Draw only rectangles in Pass #1 because if drawn in PCL byte order, rectangles cover up text - //********************************************************************************************* - mParsePclIs1stPass = true; mPclParser = new PclParser(mCurrentClickedPagePclBytes, this); // Parse the PCL bytes from the RmsTools PclParser - -// PriDebug.infoln("PclRenderImage> parseAndRender(). Before pass1"); - mPclParser.ParsePCL(); // does callbacks to the 2 interface methods below as necessary (making the BufferedImage) -// PriDebug.infoln("PclRenderImage> parseAndRender(). After pass1"); - - /* Default to Courier and set to default paper size and 6 lines per vertical inch and offset top margin by 3 print lines - * for those Pcl files that were dieted/scrubbed and have those commands taken out. - * Also some Blockument pages start with Fill instead of non fill text don't specifiy a font or LPI or top margin */ - mPriFonts.setJavaBuiltInFont(4099); - mPriPageSettings.setToInitialValues(); - - //********************************************************************************************* - // Parse pass 2. Only rectangles were drawn in Pass #1. Now draw everything else in Pass #2 - //********************************************************************************************* - mParsePclIs1stPass = false; - mPclParser = new PclParser(mCurrentClickedPagePclBytes, this); // Parse the PCL bytes from the RmsTools PclParser - -// PriDebug.infoln("PclRenderImage> parseAndRender(). Before pass2"); - - mPclParser.ParsePCL(); // does callbacks to the 2 interface methods below as necessary (making the BufferedImage) mPriDrawText.drawBufferedUpCharsAs1String(); // If any text chars were at the very end of the input PCL file // PriDebug.infoln("PclRenderImage> parseAndRender(). After pass2"); Modified: openpcl/src/com/openpcl/pclrenderimage/macro/PriParseMacroBytes.java =================================================================== --- openpcl/src/com/openpcl/pclrenderimage/macro/PriParseMacroBytes.java 2007-12-07 23:12:58 UTC (rev 214) +++ openpcl/src/com/openpcl/pclrenderimage/macro/PriParseMacroBytes.java 2008-02-19 18:42:03 UTC (rev 215) @@ -143,25 +143,13 @@ mPclRenderImage.getPriPageSettings().setLineSpacing(6); // 6 lines per inch vertical mPclRenderImage.getPriPageSettings().setTopMarginAdjustment(3); // All (x,y) are transformed 3 lines down mPclParser = new PclParser(htPclByteArray, mPclRenderImage); // Parse and render on current image - mPclRenderImage.setParsePclIs1stPass(true); // Important: Run the first pass mPclParser.ParsePCL(); // callbacks to the 2 interface methods to render on the current image - - mPclRenderImage.getPriFonts().setJavaBuiltInFont(4099); // 4099 is Courier - mPclRenderImage.getPriPageSettings().setLineSpacing(6); // 6 lines per inch vertical - mPclRenderImage.getPriPageSettings().setTopMarginAdjustment(3); // All (x,y) are transformed 3 lines down - mPclParser = new PclParser(htPclByteArray, mPclRenderImage); // Parse and render on current image - mPclRenderImage.setParsePclIs1stPass(false); // Important: Run the second pass - mPclParser.ParsePCL(); // callbacks to the 2 interface methods to render on the current image - -// PriDebug.releaseln(PriDebug.spacesForPclParseMsgs + "Executed Macro ID " + mCurrentMacroId + " (" + -// htPclByteArray.length + " PCL bytes)."); } /** Save full state then call macro (different from execute macro) */ public void saveFullStateThenCallMacro() { // Dont' save full state like "Call Macro" should do. Just execute the macro. Then don't restore full state either. executeMacro(); -// PriDebug.infoln(PriDebug.spacesForPclParseMsgs + "Call Macro ID " + mCurrentMacroId); } /** Save full state then call macro (different from execute macro) */ Modified: openpcl/src/com/openpcl/pclrenderimage/render/PriDecompressPclBytes.java =================================================================== --- openpcl/src/com/openpcl/pclrenderimage/render/PriDecompressPclBytes.java 2007-12-07 23:12:58 UTC (rev 214) +++ openpcl/src/com/openpcl/pclrenderimage/render/PriDecompressPclBytes.java 2008-02-19 18:42:03 UTC (rev 215) @@ -57,8 +57,10 @@ dataCount -= cnt; // dataStartOffset += cnt; - if (cnt > width - numberOfDecompressedBytes) + if (cnt > (width - numberOfDecompressedBytes)){ cnt = width - numberOfDecompressedBytes; + } + while (cnt-- > 0) decompressed.add(numberOfDecompressedBytes++, new Byte(data[dataStartOffset++])); @@ -78,12 +80,12 @@ } /** - * Returns decompressed Run Lenght data. - * @param data data to decompress + * Returns uncompressed Run Length data. + * @param data data to uncompressed * @param startOffset data start offset * @param width data width * @param count data element count - * @return Decompressed data. + * @return uncompressed data. */ public byte[] decompressRL(byte[] data, int startOffset, int width, int count) { /*type 1 compression*/ @@ -107,7 +109,7 @@ } /** - * Returns decompressed Delra Row data. + * Returns decompressed Delta Row data. * @param data data to decompress * @param startOffset data start offset * @param width data width Modified: openpcl/src/com/openpcl/pclrenderimage/render/PriFonts.java =================================================================== --- openpcl/src/com/openpcl/pclrenderimage/render/PriFonts.java 2007-12-07 23:12:58 UTC (rev 214) +++ openpcl/src/com/openpcl/pclrenderimage/render/PriFonts.java 2008-02-19 18:42:03 UTC (rev 215) @@ -393,7 +393,7 @@ // PriDebug.infoln(PriDebug.spacesForPclParseMsgs + "PriFonts set Symbol Set to PC8"); break; default: // (<other>U - setSymbolSetIsUnsupported( pSymbolSetInGroupU, "U"); + setSymbolSetIsUnsupported( pSymbolSetInGroupU, 'U'); break; } makeFontCurrent(); @@ -407,7 +407,7 @@ * @param pSymbolSetIsUnsupported * @param pCmdTerminator */ - public void setSymbolSetIsUnsupported(int pSymbolSetIsUnsupported, String pCmdTerminator) { + public void setSymbolSetIsUnsupported(int pSymbolSetIsUnsupported, char pCmdTerminator) { mCurrentSymbolSet = sFontSymbolSetIsOther; // PriDebug.infoln(PriDebug.spacesForPclParseMsgs + // "Error> PCL source file has unsupported Symbol Set \"" + pSymbolSetIsUnsupported + pCmdTerminator + Modified: openpcl/src/com/openpcl/pclrenderimage/tools/PclCommandEvent.java =================================================================== --- openpcl/src/com/openpcl/pclrenderimage/tools/PclCommandEvent.java 2007-12-07 23:12:58 UTC (rev 214) +++ openpcl/src/com/openpcl/pclrenderimage/tools/PclCommandEvent.java 2008-02-19 18:42:03 UTC (rev 215) @@ -7,7 +7,7 @@ */ public interface PclCommandEvent { - public void commandFoundEvent(String cmdLeadin, String cmdValue, String cmdTerminator, byte[] cmdData, int bufferPos); + public void commandFoundEvent(String cmdLeadin, String cmdValue, char cmdTerminator, byte[] cmdData, int bufferPos); public void charFoundEvent( char nextChar, int bufferPos ); Modified: openpcl/src/com/openpcl/pclrenderimage/tools/PclParser.java =================================================================== --- openpcl/src/com/openpcl/pclrenderimage/tools/PclParser.java 2007-12-07 23:12:58 UTC (rev 214) +++ openpcl/src/com/openpcl/pclrenderimage/tools/PclParser.java 2008-02-19 18:42:03 UTC (rev 215) @@ -45,12 +45,12 @@ public class PclParser { private int pclState = 1; - private String cmdPrefix; - private String cmdGroup; + private char cmdPrefix; + private char cmdGroup; private String cmdLeadin; // Command Prefix + command Group private String cmdValue; // The parameter value may be multiple digits (or empty) - private String cmdTerminator; // This may be "" (empty) (on 2-char commands) + private char cmdTerminator; // This may be "" (empty) (on 2-char commands) private byte[] cmdData; // This will be "" (empty) except special cases private int bufferPos = -1; // Position of current character. @@ -114,37 +114,36 @@ * There should be a term coming up (Esc or term waiting) */ public int getOneCommand() throws ParseException, IOException { - cmdValue = ""; + cmdValue = null; if (pclState==2) { // we've seen an escape so start a command: cmdPrefix = GetCharFromBuffer(); // The 2-char commands are hardcoded, but we could just check Upper Case? : - if ( isUpperCase(cmdPrefix) || ("=9EYZ".indexOf(cmdPrefix) > -1) ) { - cmdGroup = ""; - cmdValue = ""; - cmdTerminator = ""; + if ( Character.isUpperCase(cmdPrefix) || ("=9EYZ".indexOf(cmdPrefix) > -1) ) { + cmdGroup = ' '; + cmdTerminator = ' '; pclState = 3; // Upper case on first character = 2 Char command } else { pclState = 6; // first term or 3 char command waiting - cmdPrefix = cmdPrefix.toUpperCase(); + cmdPrefix = Character.toUpperCase(cmdPrefix); cmdValue = GetNumFromBuffer(); // only sees a number on 3 char command (ex: '^(0U') cmdGroup = GetCharFromBuffer(); - if ( isUpperCase(cmdGroup) ) { + if ( Character.isUpperCase(cmdGroup) ) { cmdTerminator = cmdGroup; - cmdGroup = ""; + cmdGroup = ' '; pclState = 4; // We're done with this command } // Why is this only done if there's a cmdValue ? - if ( cmdValue.length() > 0) cmdTerminator = cmdTerminator.toUpperCase(); + if ( cmdValue.length() > 0) cmdTerminator = Character.toUpperCase(cmdTerminator); } } - if ((pclState==6 || pclState==7) && (cmdValue.length() == 0)) { //term waiting + if ((pclState==6 || pclState==7) && (cmdValue == null || cmdValue.length() == 0)) { //term waiting cmdValue = GetNumFromBuffer(); cmdTerminator = GetCharFromBuffer(); // (char)buffer.read(); - if ( isUpperCase( cmdTerminator ) || cmdTerminator.equals("@") ) { // This is the last term: + if ( Character.isUpperCase( cmdTerminator ) || cmdTerminator == '@' ) { // This is the last term: pclState = pclState - 2; // State 6 -> 4, 7 -> 5 } else { - cmdTerminator = cmdTerminator.toUpperCase(); // Make lookups easier (but state shows we have more) + cmdTerminator = Character.toUpperCase(cmdTerminator); // Make lookups easier (but state shows we have more) } } @@ -152,15 +151,22 @@ * Commands that ends with 'W' have data following them * ex: Soft font header: ')sxxW'; Transfer Raster: '*b,W'; etc. */ - if ((pclState==4 || pclState==6 || pclState==7) && cmdTerminator.equals("W") ) { + if ((pclState==4 || pclState==6 || pclState==7) && cmdTerminator == 'W' ) { int numChars = Integer.parseInt( cmdValue ); // BOA ERROR: Throwing 'NumberFormatException' ? (Blank string) cmdData = GetBytesFromBuffer( numChars ); pclState = Math.min(pclState + 1, 7 ); // 4 becomes 5, 6 becomes 7 ?? } else { cmdData = null; } + StringBuffer cmdLeadinBuilder =new StringBuffer(); + if(cmdPrefix != ' '){ + cmdLeadinBuilder.append(cmdPrefix); + } + if(cmdGroup != ' '){ + cmdLeadinBuilder.append(cmdGroup); + } // Put the command back together for table lookup, etc - cmdLeadin = "" + cmdPrefix + cmdGroup; + cmdLeadin = cmdLeadinBuilder.toString(); if (pclState == 3 || pclState==4 || pclState==5) { pclState = 1; // We are DONE with this command, back to parsing chars... @@ -168,10 +174,10 @@ return pclState; } - public String GetCharFromBuffer() throws IOException { + public char GetCharFromBuffer() throws IOException { char c = (char)buffer.read(); bufferPos++; - return ( String.valueOf(c) ); // will this work ? + return c; } public byte[] GetBytesFromBuffer( int numChars ) throws IOException { @@ -182,22 +188,25 @@ } public String GetNumFromBuffer() throws ParseException, IOException { - String number = ""; + StringBuffer numberBuffer = new StringBuffer(); int ch; while ( (ch = buffer.read()) != -1) { bufferPos++; char c = (char)ch; if ( Character.isDigit(c) || c=='.' || c=='+' || c=='-' ) { - number += c; + numberBuffer.append(c); } else { buffer.unread(c); // Back into the PushbackReader bufferPos--; break; } } - if ((ch == -1) && number.equals("")) + String response = numberBuffer.toString(); + if ((ch == -1) && response.equals("")){ throw new ParseException("Expecting a Number", bufferPos); // IOException(); - return number; + } + + return response; } /** Modified: openpcl/src/com/openpcl/pclrenderimage/util/PriModifyPclBytes.java =================================================================== --- openpcl/src/com/openpcl/pclrenderimage/util/PriModifyPclBytes.java 2007-12-07 23:12:58 UTC (rev 214) +++ openpcl/src/com/openpcl/pclrenderimage/util/PriModifyPclBytes.java 2008-02-19 18:42:03 UTC (rev 215) @@ -51,7 +51,7 @@ } public void commandFoundEvent( - String pCmdLeadin, String pCmdValue, String pCmdTerminator, byte[] pCmdData, int pBufferPos) { + String pCmdLeadin, String pCmdValue, char pCmdTerminator, byte[] pCmdData, int pBufferPos) { String pclCmd = pCmdLeadin + "," + pCmdTerminator; // Put into char array to not do a lot of String.substring() commands later @@ -97,8 +97,8 @@ } // Write the terminating char - if (pCmdTerminator != null && pCmdTerminator.length() > 0) { - mByteArrayOutputStream.write(pCmdTerminator.getBytes()); + if (pCmdTerminator > 0) { + mByteArrayOutputStream.write(pCmdTerminator); } // Write the raster data or soft font data bytes This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <doc...@us...> - 2007-12-07 23:12:53
|
Revision: 214 http://openpcl.svn.sourceforge.net/openpcl/?rev=214&view=rev Author: documentsystems Date: 2007-12-07 15:12:58 -0800 (Fri, 07 Dec 2007) Log Message: ----------- Howard Hoagland. In the JSmooth config file, changed initialMemoryHeap from 256 to -1 and maximumMemoryHeap from 512 to -1, else the install fails. Modified Paths: -------------- openpcl/src/com/openpcl/install/localinstaller/openpclviewer.jsmooth Modified: openpcl/src/com/openpcl/install/localinstaller/openpclviewer.jsmooth =================================================================== --- openpcl/src/com/openpcl/install/localinstaller/openpclviewer.jsmooth 2007-12-07 23:09:37 UTC (rev 213) +++ openpcl/src/com/openpcl/install/localinstaller/openpclviewer.jsmooth 2007-12-07 23:12:58 UTC (rev 214) @@ -12,9 +12,9 @@ <jarLocation>../../../../../build/rel/openpclviewer-installer.jar</jarLocation> <executableName>../../../../../build/rel/openpclviewer-setup.exe</executableName> <iconLocation>../../../../../src/com/openpcl/viewer/images/V221PclIcon32.png</iconLocation> - <initialMemoryHeap>256</initialMemoryHeap> + <initialMemoryHeap>-1</initialMemoryHeap> <mainClassName>com.izforge.izpack.installer.Installer</mainClassName> - <maximumMemoryHeap>512</maximumMemoryHeap> + <maximumMemoryHeap>-1</maximumMemoryHeap> <maximumVersion></maximumVersion> <minimumVersion>1.5.0</minimumVersion> <skeletonName>Windowed Wrapper</skeletonName> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <doc...@us...> - 2007-12-07 23:09:35
|
Revision: 213 http://openpcl.svn.sourceforge.net/openpcl/?rev=213&view=rev Author: documentsystems Date: 2007-12-07 15:09:37 -0800 (Fri, 07 Dec 2007) Log Message: ----------- Howard Hoagland. Added "synchronized" to the getImageForPage() method because the synchronized had to be taken off of the PclRenderImage.parseAndRender() method, because PclRenderImage is doing double duty as the render engine for OpenPCLViewer and also is being used as the render engine in a J2EE container running many threads at once. 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-12-07 22:12:12 UTC (rev 212) +++ openpcl/src/com/openpcl/viewer/OpenPCLViewer.java 2007-12-07 23:09:37 UTC (rev 213) @@ -1752,7 +1752,7 @@ * @param pZoomFactor. This is mandatory (see note for why). * @return BufferedImage. If null, then get the return String from PclRenderImage.getLastErrorString() */ - public BufferedImage getImageForPage(int pPageNumber, byte[] pPrintTimePclBytes, + public synchronized BufferedImage getImageForPage(int pPageNumber, byte[] pPrintTimePclBytes, boolean pIsForPrinting, String pPaperSize, double pZoomFactor) { if (mPosViewSelected != null) { PriDebug.infoln("OpenPCLViewer> getImageForPage(page=" + pPageNumber + ", boolean printing=" + 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...> - 2007-12-05 21:15:22
|
Revision: 211 http://openpcl.svn.sourceforge.net/openpcl/?rev=211&view=rev Author: documentsystems Date: 2007-12-05 13:15:26 -0800 (Wed, 05 Dec 2007) Log Message: ----------- Howard Hoagland. Changed website/doc dir from ${doc.dir} to doc Modified Paths: -------------- openpcl/build.xml Modified: openpcl/build.xml =================================================================== --- openpcl/build.xml 2007-12-05 21:12:06 UTC (rev 210) +++ openpcl/build.xml 2007-12-05 21:15:26 UTC (rev 211) @@ -222,10 +222,10 @@ <fileset dir="${src.data.dir}"/> </copy> <!-- Copy the everything in doc --> - <mkdir dir="${rel.website.dir}/${doc.dir}"/> - <copy todir="${rel.website.dir}/${doc.dir}"> - <fileset dir="${doc.dir}"/> - </copy> + <mkdir dir="${rel.website.dir}/doc"/> + <copy todir="${rel.website.dir}/doc"> + <fileset dir="${doc.dir}"/> + </copy> <echo>Finished OpenPCL Ant build.xml "website" target.</echo> <echo>Upload the contents of ${rel.website.dir} to the project website</echo> </target> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <doc...@us...> - 2007-12-05 21:12:02
|
Revision: 210 http://openpcl.svn.sourceforge.net/openpcl/?rev=210&view=rev Author: documentsystems Date: 2007-12-05 13:12:06 -0800 (Wed, 05 Dec 2007) Log Message: ----------- Howard Hoagland. Corrected name of TableLayout.jar for Internet Explorer applet Modified Paths: -------------- openpcl/src/com/openpcl/install/website/applet.html openpcl/src/com/openpcl/install/website/appletHowToAutoOpenAFile.html Modified: openpcl/src/com/openpcl/install/website/applet.html =================================================================== --- openpcl/src/com/openpcl/install/website/applet.html 2007-12-05 20:14:18 UTC (rev 209) +++ openpcl/src/com/openpcl/install/website/applet.html 2007-12-05 21:12:06 UTC (rev 210) @@ -13,7 +13,7 @@ <param name="code" value="com.openpcl.viewer.applet.OpenPCLApplet.class"/> <param name="codebase" value="http://openpcl.sourceforge.net/"/> <param name="type" value="application/x-java-applet;jpi-version=1.5.0"/> - <param name="archive" value="openpcl.jar,ableLayout.jar"/> + <param name="archive" value="openpcl.jar,TableLayout.jar"/> <param name="scriptable" value="false"/> <comment Internet Explorer runs the above because IE understands the object tag and doesn't understand the embed tag. Firefox runs the below because Firefox doesn't understand the object tag but does understand the embed tag. Modified: openpcl/src/com/openpcl/install/website/appletHowToAutoOpenAFile.html =================================================================== --- openpcl/src/com/openpcl/install/website/appletHowToAutoOpenAFile.html 2007-12-05 20:14:18 UTC (rev 209) +++ openpcl/src/com/openpcl/install/website/appletHowToAutoOpenAFile.html 2007-12-05 21:12:06 UTC (rev 210) @@ -13,7 +13,7 @@ <param name="code" value="com.openpcl.viewer.applet.OpenPCLApplet.class"/> <param name="codebase" value="http://openpcl.sourceforge.net/"/> <param name="type" value="application/x-java-applet;jpi-version=1.5.0"/> - <param name="archive" value="openpcl.jar,ableLayout.jar"/> + <param name="archive" value="openpcl.jar,TableLayout.jar"/> <param name="scriptable" value="false"/> <param name="openfile" value="c:/temp/LoanApp1003.pcl"/> <comment Internet Explorer runs the above because IE understands the object tag and doesn't understand the embed tag. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <doc...@us...> - 2007-12-05 20:14:13
|
Revision: 209 http://openpcl.svn.sourceforge.net/openpcl/?rev=209&view=rev Author: documentsystems Date: 2007-12-05 12:14:18 -0800 (Wed, 05 Dec 2007) Log Message: ----------- Howard Hoagland. Changed IZPack base dir from build/rel to build. Modified Paths: -------------- openpcl/build.xml Modified: openpcl/build.xml =================================================================== --- openpcl/build.xml 2007-12-05 20:12:17 UTC (rev 208) +++ openpcl/build.xml 2007-12-05 20:14:18 UTC (rev 209) @@ -130,6 +130,9 @@ <fileset dir="${build.dir}" includes="pclrenderimage.jar"/> <fileset dir="${lib.dir}" includes="TableLayout.jar"/> </copy> + <copy todir="${build.dir}"> + <fileset dir="${lib.dir}" includes="TableLayout.jar"/> + </copy> <!-- Sign the jars --> <signjar alias="${keystore.alias}" keystore="${keystore.file}" storepass="${keystore.password}"> <fileset dir="${rel.dir}"> @@ -186,7 +189,7 @@ <izpack input="${src.localinstaller.dir}/openpclviewer-izpack.xml" output="${rel.dir}/openpclviewer-installer.jar" installerType="standard" - basedir="${rel.dir}" + basedir="${build.dir}" izPackDir="${izpack.dir}/"/> <echo/> <echo>To create the windows installer .exe, download JSmooth from (http://jsmooth.sourceforge.net)</echo> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <doc...@us...> - 2007-12-05 20:12:13
|
Revision: 208 http://openpcl.svn.sourceforge.net/openpcl/?rev=208&view=rev Author: documentsystems Date: 2007-12-05 12:12:17 -0800 (Wed, 05 Dec 2007) Log Message: ----------- Howard Hoagland. Fixed relative dir path to IZPack .jar file, fixed file name of app icon and it's relative dir path Modified Paths: -------------- openpcl/src/com/openpcl/install/localinstaller/openpclviewer.jsmooth Modified: openpcl/src/com/openpcl/install/localinstaller/openpclviewer.jsmooth =================================================================== --- openpcl/src/com/openpcl/install/localinstaller/openpclviewer.jsmooth 2007-12-05 19:08:07 UTC (rev 207) +++ openpcl/src/com/openpcl/install/localinstaller/openpclviewer.jsmooth 2007-12-05 20:12:17 UTC (rev 208) @@ -7,14 +7,14 @@ <JVMSearchPath>exepath</JVMSearchPath> <JVMSearchPath>jview</JVMSearchPath> <arguments></arguments> - <classPath>../../../../../rel/openpclviewer-installer.jar</classPath> + <classPath>../../../../../build/rel/openpclviewer-installer.jar</classPath> <embeddedJar>true</embeddedJar> - <jarLocation>../../../../../rel/openpclviewer-installer.jar</jarLocation> - <executableName>../../../../../rel/openpclviewer-setup.exe</executableName> - <iconLocation>../../../../../src/com/openpcl/viewer/images/pclIcon_32x32.png</iconLocation> - <initialMemoryHeap>-1</initialMemoryHeap> + <jarLocation>../../../../../build/rel/openpclviewer-installer.jar</jarLocation> + <executableName>../../../../../build/rel/openpclviewer-setup.exe</executableName> + <iconLocation>../../../../../src/com/openpcl/viewer/images/V221PclIcon32.png</iconLocation> + <initialMemoryHeap>256</initialMemoryHeap> <mainClassName>com.izforge.izpack.installer.Installer</mainClassName> - <maximumMemoryHeap>-1</maximumMemoryHeap> + <maximumMemoryHeap>512</maximumMemoryHeap> <maximumVersion></maximumVersion> <minimumVersion>1.5.0</minimumVersion> <skeletonName>Windowed Wrapper</skeletonName> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <doc...@us...> - 2007-12-05 19:08:03
|
Revision: 207 http://openpcl.svn.sourceforge.net/openpcl/?rev=207&view=rev Author: documentsystems Date: 2007-12-05 11:08:07 -0800 (Wed, 05 Dec 2007) Log Message: ----------- Howard Hoagland. Added company website url Modified Paths: -------------- openpcl/src/com/openpcl/install/webstart/openpclviewer.jnlp Modified: openpcl/src/com/openpcl/install/webstart/openpclviewer.jnlp =================================================================== --- openpcl/src/com/openpcl/install/webstart/openpclviewer.jnlp 2007-12-05 19:06:31 UTC (rev 206) +++ openpcl/src/com/openpcl/install/webstart/openpclviewer.jnlp 2007-12-05 19:08:07 UTC (rev 207) @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <jnlp spec="1.5+" codebase="http://openpcl.sourceforge.net" href="openpclviewer.jnlp"> -<!-- JNLP file for OpenPCLViewer. HowardH --> +<!-- JNLP file for OpenPCLViewer. www.docmagic.com Howard Hoagland --> <information> <title>OpenPCLViewer WebStart</title> <vendor>Document Systems, Inc</vendor> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <doc...@us...> - 2007-12-05 19:06:28
|
Revision: 206 http://openpcl.svn.sourceforge.net/openpcl/?rev=206&view=rev Author: documentsystems Date: 2007-12-05 11:06:31 -0800 (Wed, 05 Dec 2007) Log Message: ----------- Howard Hoagland. Removed jdom.jar from the JNLP file Modified Paths: -------------- openpcl/src/com/openpcl/install/webstart/openpclviewer.jnlp Modified: openpcl/src/com/openpcl/install/webstart/openpclviewer.jnlp =================================================================== --- openpcl/src/com/openpcl/install/webstart/openpclviewer.jnlp 2007-12-05 19:04:39 UTC (rev 205) +++ openpcl/src/com/openpcl/install/webstart/openpclviewer.jnlp 2007-12-05 19:06:31 UTC (rev 206) @@ -21,7 +21,6 @@ <resources> <j2se version="1.5+" href="http://java.sun.com/products/autodl/j2se" initial-heap-size="64m" max-heap-size="512m"/> <jar main="true" href="openpcl.jar" download="eager"/> - <jar href="jdom.jar" download="eager"/> <jar href="TableLayout.jar" download="eager"/> </resources> <application-desc main-class="com.openpcl.viewer.OpenPCLViewer"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |