com.idautomation.pdf417
Class PDF417

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Canvas
          extended bycom.idautomation.pdf417.PDF417
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class PDF417
extends java.awt.Canvas
implements java.io.Serializable

This is the main PDF417 class that generates the PDF417 barcode image

See Also:
Serialized Form

Field Summary
 boolean autoSize
          If true will automatically size the control canvas to fit the barcode at design or runtime; Default =True.
 java.awt.Color backColor
          Background color.
 java.awt.Color barColor
          Color of the bars.
 byte[] binaryCode
          The data (as a byte array) to be encoded in the barcode.
 java.lang.String code
          The data (as a string) to be encoded in the barcode.
 java.lang.String codeText
          Text to display after encoding.
 java.awt.Color fontColor
          Color of the text.
 double H
           
 int height
           
 double I
           
 double L
           
 double leftMarginCM
          Left margin of the Barcode (also know as quite zone).
 boolean MacroPDFEnable
          Determines whether or not this barcode is a MacroPDF barcode.
 int MacroPDFFileID
          The MacroPDF File ID corresponding to this barcode.
 boolean MacroPDFLastSegment
          Determines whether this MacroPDF barcode is the last in the series
 int MacroPDFSegmentIndex
          The MacroPDF Segment Index corresponding to this barcode.
 double N
           
static int PDF_BINARY
           
static int PDF_NUMERIC
           
static int PDF_TEXT
           
 int PDFColumns
          The number of columns in the PDF417 code; the default is 5; the range is from 1 to 30.
 int PDFECLevel
          PDF417 error correction level; the default is 2; the range is from 0 to 8.
 int PDFMode
          PDF417 mode; Valid values are PDF_BINARY (default), PDF_TEXT (for ascii data) and PDF_NUMERIC (for numeric only data).
 int PDFRows
          The number of rows of the PDF417 code; If 0 (default) the number will be calculated automatically.
 int pHeight
          The preferred width of the barcode image in pixels after barcode is generated.
 boolean processTilde
          If true, three numbers after the Tilde will insert an ASCII code; For example ~009 will insert ASCII 9 into the data string.
 int pWidth
          The preferred width of the barcode image in pixels after barcode is generated.
 int resolution
          The resolution used to create the X dimension and other measurements in pixels; Default is 38 Pixels Per CM which is about 96 DPI.
 int rotate
          Rotation angle; valid values are 0 (default), 90, 180 & 270.
 java.awt.Font textFont
          Font of the text.
 double topMarginCM
          Top margin of the Barcode (also know as quite zone).
 boolean truncated
          If true, truncated PDF417 code will be created; Default =False.
 int width
           
 double X
          Size in CM of narrow modules; if X * resolution = < 1, X will be set to one pixel; resolution is used to convert to pixels; use setPixelsPerCM to change the resolution.
 double XtoYRatio
          The X multiple height of individual cells; default=3, usually 2 to 4 times X (make as small as possible, some scanners cannot read less than 3 or 4).
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
PDF417()
           
 
Method Summary
 boolean getAutoSize()
          If true will automatically size the control canvas to fit the barcode at design or runtime; Default =True.
 java.awt.Color getBackground()
          Gets the background color.
 java.lang.String getDataToEncode()
           
 java.awt.Font getFont()
           
 java.awt.Color getForeground()
           
 double getLeftMarginCM()
          Gets the left margin of the Barcode (also know as quite zone).
 boolean getMacroPDFEnable()
          Returns a boolean indicating whether or not this barcode is a MacroPDF
 int getMacroPDFFileID()
          Gets the MacroPDF file identifier.
 boolean getMacroPDFLastSegment()
          Returns a boolean representing the MacroPDFLastSegment
 int getMacroPDFSegmentIndex()
          Gets the MacroPDF Segment Index for this barcode
 java.awt.Dimension getMinimumSize()
           
 int getPDFColumns()
          Gets the number of columns in the PDF417 code; the default is 5; the range is from 1 to 30.
 int getPDFErrorCorrection()
          Gets the PDF417 error correction level; the default is 2; the range is from 0 to 8.
 int getPDFMode()
           
 int getPDFRows()
          Gets the number of rows of the PDF417 code.
 int getPixelsPerCM()
          Gets the resolution used to convert from CM to pixels; Default is 38.
 java.awt.Dimension getPreferredSize()
          Returns the size in pixels appropriate for the generated image after it is generated.
 boolean getProcessTilde()
           
 int getRotationAngle()
          Gets the rotation angle; valid values are 0 (default), 90, 180 & 270.
 java.awt.Color getTextFontColor()
           
 double getTopMarginCM()
          Gets the top margin of the Barcode (also know as quite zone).
 boolean getTruncated()
           
 double getXDimensionCM()
          Gets the size in CM of narrow modules; if X * resolution = < 1, X will be set to one pixel; resolution is used to convert to pixels; use setPixelsPerCM to change the resolution.
 double getXtoYRatio()
           
 void paint(java.awt.Graphics g2)
          Paints the barcode and rotates it if necessary
 void setAutoSize(boolean newVal)
          If true will automatically size the control canvas to fit the barcode at design or runtime; Default =True.
 void setBackground(java.awt.Color newColor)
          Sets the background color.
 void setDataToEncode(java.lang.String newCode)
          The data (as a string) to be encoded in the barcode.
 void setFont(java.awt.Font newFont)
           
 void setForeground(java.awt.Color newColor)
          Color of the bars.
 void setLeftMarginCM(double newMargin)
          Sets the left margin of the Barcode (also know as quite zone).
 void setMacroPDFEnable(boolean Macro)
          Sets whether or not this barcode is a MacroPDF
 void setMacroPDFFileID(int fileid)
          Sets the MacroPDF file identifier.
 void setMacroPDFLastSegment(boolean Macro)
          Sets the MacroPDFLastSegment variable
 void setMacroPDFSegmentIndex(int index)
          Sets the MacroPDF Segment Index for this barcode
 void setPDFColumns(int newColumns)
          Sets the number of columns in the PDF417 code; the default is 5; the range is from 1 to 30.
 void setPDFErrorCorrection(int newEC)
          Sets the PDF417 error correction level; the default is 2; the range is from 0 to 8.
 void setPDFMode(int newMode)
          PDF417 mode; Valid values are PDF_BINARY (default), PDF_TEXT (for ascii data) and PDF_NUMERIC (for numeric only data).
 void setPDFRows(int newRows)
          Sets the number of rows of the PDF417 code; If 0 (default) the number will be calculated automatically.
 void setPixelsPerCM(int newRes)
          Sets the resolution used to convert from CM to pixels; Default is 38.
 void setProcessTilde(boolean pt)
           
 void setRotationAngle(int newRotate)
          Sets the rotation angle; valid values are 0 (default), 90, 180 & 270.
 void setTextFontColor(java.awt.Color newColor)
           
 void setTopMarginCM(double newMargin)
          Sets the top margin of the Barcode (also know as quite zone).
 void setTruncated(boolean newVal)
          If true, truncated PDF417 code will be created; Default =False.
 void setXDimensionCM(double newX)
          Sets the size in CM of narrow modules; if X * resolution = < 1, X will be set to one pixel; resolution is used to convert to pixels; use setPixelsPerCM to change the resolution.
 void setXtoYRatio(double newRatio)
          The X multiple height of individual cells; default=3, usually 2 to 5 times X (make as small as possible, some scanners cannot read less than 3 or 4).
 
Methods inherited from class java.awt.Canvas
addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy, update
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, dispatchEvent, doLayout, enable, enable, enableInputMethods, getAlignmentX, getAlignmentY, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFontMetrics, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

code

public java.lang.String code
The data (as a string) to be encoded in the barcode.


binaryCode

public byte[] binaryCode
The data (as a byte array) to be encoded in the barcode.


processTilde

public boolean processTilde
If true, three numbers after the Tilde will insert an ASCII code; For example ~009 will insert ASCII 9 into the data string.


leftMarginCM

public double leftMarginCM
Left margin of the Barcode (also know as quite zone). The default is .2 CM.


topMarginCM

public double topMarginCM
Top margin of the Barcode (also know as quite zone). The default is .2 CM


backColor

public java.awt.Color backColor
Background color.


codeText

public java.lang.String codeText
Text to display after encoding.


resolution

public int resolution
The resolution used to create the X dimension and other measurements in pixels; Default is 38 Pixels Per CM which is about 96 DPI. 96 DPI is the resolution of the web browser; this setting works best when using the servlet. Enter 118 to create a 300 DPI image.


MacroPDFEnable

public boolean MacroPDFEnable
Determines whether or not this barcode is a MacroPDF barcode.


MacroPDFSegmentIndex

public int MacroPDFSegmentIndex
The MacroPDF Segment Index corresponding to this barcode. Valid values are 0 to 99998


MacroPDFFileID

public int MacroPDFFileID
The MacroPDF File ID corresponding to this barcode. Valid values are 0 to 899


MacroPDFLastSegment

public boolean MacroPDFLastSegment
Determines whether this MacroPDF barcode is the last in the series


N

public double N

X

public double X
Size in CM of narrow modules; if X * resolution = < 1, X will be set to one pixel; resolution is used to convert to pixels; use setPixelsPerCM to change the resolution.


XtoYRatio

public double XtoYRatio
The X multiple height of individual cells; default=3, usually 2 to 4 times X (make as small as possible, some scanners cannot read less than 3 or 4).


truncated

public boolean truncated
If true, truncated PDF417 code will be created; Default =False.


width

public int width

height

public int height

pWidth

public int pWidth
The preferred width of the barcode image in pixels after barcode is generated.


pHeight

public int pHeight
The preferred width of the barcode image in pixels after barcode is generated.


autoSize

public boolean autoSize
If true will automatically size the control canvas to fit the barcode at design or runtime; Default =True.


textFont

public java.awt.Font textFont
Font of the text.


fontColor

public java.awt.Color fontColor
Color of the text.


barColor

public java.awt.Color barColor
Color of the bars.


I

public double I

H

public double H

L

public double L

rotate

public int rotate
Rotation angle; valid values are 0 (default), 90, 180 & 270.


PDFRows

public int PDFRows
The number of rows of the PDF417 code; If 0 (default) the number will be calculated automatically. We recommend changing the columns instead of the rows to size the symbol.


PDFColumns

public int PDFColumns
The number of columns in the PDF417 code; the default is 5; the range is from 1 to 30.


PDFECLevel

public int PDFECLevel
PDF417 error correction level; the default is 2; the range is from 0 to 8.


PDFMode

public int PDFMode
PDF417 mode; Valid values are PDF_BINARY (default), PDF_TEXT (for ascii data) and PDF_NUMERIC (for numeric only data).


PDF_BINARY

public static final int PDF_BINARY
See Also:
Constant Field Values

PDF_TEXT

public static final int PDF_TEXT
See Also:
Constant Field Values

PDF_NUMERIC

public static final int PDF_NUMERIC
See Also:
Constant Field Values
Constructor Detail

PDF417

public PDF417()
Method Detail

setDataToEncode

public void setDataToEncode(java.lang.String newCode)
The data (as a string) to be encoded in the barcode.


getDataToEncode

public java.lang.String getDataToEncode()

getProcessTilde

public boolean getProcessTilde()

setProcessTilde

public void setProcessTilde(boolean pt)

setLeftMarginCM

public void setLeftMarginCM(double newMargin)
Sets the left margin of the Barcode (also know as quite zone). The default is .2 CM.


getLeftMarginCM

public double getLeftMarginCM()
Gets the left margin of the Barcode (also know as quite zone). The default is .2 CM.


setTopMarginCM

public void setTopMarginCM(double newMargin)
Sets the top margin of the Barcode (also know as quite zone). The default is .2 CM


getTopMarginCM

public double getTopMarginCM()
Gets the top margin of the Barcode (also know as quite zone). The default is .2 CM


setBackground

public void setBackground(java.awt.Color newColor)
Sets the background color.


getBackground

public java.awt.Color getBackground()
Gets the background color.


getMacroPDFEnable

public boolean getMacroPDFEnable()
Returns a boolean indicating whether or not this barcode is a MacroPDF


setMacroPDFEnable

public void setMacroPDFEnable(boolean Macro)
Sets whether or not this barcode is a MacroPDF


getMacroPDFSegmentIndex

public int getMacroPDFSegmentIndex()
Gets the MacroPDF Segment Index for this barcode


setMacroPDFSegmentIndex

public void setMacroPDFSegmentIndex(int index)
Sets the MacroPDF Segment Index for this barcode


getMacroPDFFileID

public int getMacroPDFFileID()
Gets the MacroPDF file identifier.


setMacroPDFFileID

public void setMacroPDFFileID(int fileid)
Sets the MacroPDF file identifier. Valid values are 0 to 899


getMacroPDFLastSegment

public boolean getMacroPDFLastSegment()
Returns a boolean representing the MacroPDFLastSegment


setMacroPDFLastSegment

public void setMacroPDFLastSegment(boolean Macro)
Sets the MacroPDFLastSegment variable


setPixelsPerCM

public void setPixelsPerCM(int newRes)
Sets the resolution used to convert from CM to pixels; Default is 38.


getPixelsPerCM

public int getPixelsPerCM()
Gets the resolution used to convert from CM to pixels; Default is 38.


setXDimensionCM

public void setXDimensionCM(double newX)
Sets the size in CM of narrow modules; if X * resolution = < 1, X will be set to one pixel; resolution is used to convert to pixels; use setPixelsPerCM to change the resolution.


getXDimensionCM

public double getXDimensionCM()
Gets the size in CM of narrow modules; if X * resolution = < 1, X will be set to one pixel; resolution is used to convert to pixels; use setPixelsPerCM to change the resolution.


setXtoYRatio

public void setXtoYRatio(double newRatio)
The X multiple height of individual cells; default=3, usually 2 to 5 times X (make as small as possible, some scanners cannot read less than 3 or 4).


getXtoYRatio

public double getXtoYRatio()

setTruncated

public void setTruncated(boolean newVal)
If true, truncated PDF417 code will be created; Default =False.


getTruncated

public boolean getTruncated()

setAutoSize

public void setAutoSize(boolean newVal)
If true will automatically size the control canvas to fit the barcode at design or runtime; Default =True.


getAutoSize

public boolean getAutoSize()
If true will automatically size the control canvas to fit the barcode at design or runtime; Default =True.


getPreferredSize

public java.awt.Dimension getPreferredSize()
Returns the size in pixels appropriate for the generated image after it is generated.


getMinimumSize

public java.awt.Dimension getMinimumSize()

setFont

public void setFont(java.awt.Font newFont)

getFont

public java.awt.Font getFont()
Specified by:
getFont in interface java.awt.MenuContainer

setTextFontColor

public void setTextFontColor(java.awt.Color newColor)

getTextFontColor

public java.awt.Color getTextFontColor()

setForeground

public void setForeground(java.awt.Color newColor)
Color of the bars.


getForeground

public java.awt.Color getForeground()

setRotationAngle

public void setRotationAngle(int newRotate)
Sets the rotation angle; valid values are 0 (default), 90, 180 & 270.


getRotationAngle

public int getRotationAngle()
Gets the rotation angle; valid values are 0 (default), 90, 180 & 270.


setPDFRows

public void setPDFRows(int newRows)
Sets the number of rows of the PDF417 code; If 0 (default) the number will be calculated automatically. We recommend changing the columns instead of the rows to size the symbol.


getPDFRows

public int getPDFRows()
Gets the number of rows of the PDF417 code.


setPDFColumns

public void setPDFColumns(int newColumns)
Sets the number of columns in the PDF417 code; the default is 5; the range is from 1 to 30.


getPDFColumns

public int getPDFColumns()
Gets the number of columns in the PDF417 code; the default is 5; the range is from 1 to 30.


setPDFErrorCorrection

public void setPDFErrorCorrection(int newEC)
Sets the PDF417 error correction level; the default is 2; the range is from 0 to 8.


getPDFErrorCorrection

public int getPDFErrorCorrection()
Gets the PDF417 error correction level; the default is 2; the range is from 0 to 8.


setPDFMode

public void setPDFMode(int newMode)
PDF417 mode; Valid values are PDF_BINARY (default), PDF_TEXT (for ascii data) and PDF_NUMERIC (for numeric only data).


getPDFMode

public int getPDFMode()

paint

public void paint(java.awt.Graphics g2)
Paints the barcode and rotates it if necessary