Menu

#3 OpenPCL does not support relative positioning

open
nobody
None
5
2010-04-14
2010-04-14
No

I have PCL produced by an AS/400, which cause the exception listed below to be thrown.

According to http://h20000.www2.hp.com/bc/docs/support/SupportManual/bpl13205/bpl13205.pdfphysical page 10 this is a ESC-&-a-#-V command to do a vertical cursor position where the position is in decipoints.

From page 9: "Relative moves are indicated by using signed numbers (e.g. # = +15 or –122);
absolute moves are indicated by unsigned numbers (e.g. # = 15 or 122)."

As the source code handling 'V* in PclRenderImage.java only does absolute positioning (as well as the 'H*), the conclusion is that relative cursor positioning is missing.

Exception in thread "AWT-EventQueue-0" java.lang.NumberFormatException: For input string: "+00060"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at com.openpcl.pclrenderimage.PclRenderImage.processMiscACommand(PclRenderImage.java:628)
at com.openpcl.pclrenderimage.PclRenderImage.commandFoundEvent(PclRenderImage.java:305)
at com.openpcl.pclrenderimage.tools.PclParser.getPclCommands(PclParser.java:108)
at com.openpcl.pclrenderimage.tools.PclParser.ParsePCL(PclParser.java:91)
at com.openpcl.pclrenderimage.PclRenderImage.parseAndRender(PclRenderImage.java:965)
at com.openpcl.pclrenderimage.PclRenderImage.getImageForPage(PclRenderImage.java:1158)
at com.openpcl.viewer.OpenPCLViewer.getImageForPage(OpenPCLViewer.java:1766)
at com.openpcl.viewer.OpenPCLViewer.renderImageCurrentPageAndZoom(OpenPCLViewer.java:1653)
at com.openpcl.viewer.OpenPCLViewer.renderImageForceZoomWidth(OpenPCLViewer.java:1614)
at com.openpcl.viewer.OpenPCLViewer.actionZoomToWidth(OpenPCLViewer.java:2319)
at com.openpcl.viewer.OpenPCLViewer.actionZoomWidth(OpenPCLViewer.java:2313)
at com.openpcl.viewer.OpenPCLViewer.actionZoomWidth(OpenPCLViewer.java:2332)
at com.openpcl.viewer.panels.PosView$3.componentResized(PosView.java:228)
at java.awt.Component.processComponentEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

Discussion

  • Thorbjørn Ravn Andersen

    • summary: penPCL does not support relative positioning --> OpenPCL does not support relative positioning
     
  • Thorbjørn Ravn Andersen

    After poking around it appears that the xPositionCommand, and yPositionCommand knows how to treat cmdValue correctly (except perhaps for leading zeroes triggering octal), but the calling code rescale the argument (probably the decipoints). By adding a float scaling factor parameter which is multiplied on to the parsed string and deleting the incorrect rescaling, the exception goes away.

     

Log in to post a comment.