|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Canvas
com.idautomation.pdf417.PDF417
This is the main PDF417 class that generates the PDF417 barcode image
Nested Class Summary |
Nested classes inherited from class java.awt.Canvas |
java.awt.Canvas.AccessibleAWTCanvas |
Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
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. |
protected int |
barHeightPixels
|
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. |
protected int[][] |
coef
PDF417 error correction coefficients. |
protected int |
currentX
Current position of painting cursor. |
protected int |
currentY
|
protected static int |
d
|
double |
H
|
int |
height
|
double |
I
|
double |
L
|
double |
leftMarginCM
Left margin of the Barcode (also know as quiet zone). |
protected int |
leftMarginPixels
|
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
|
protected double |
narrowBarCM
|
protected int |
narrowBarPixels
|
static int |
PDF_BINARY
|
static int |
PDF_NUMERIC
|
static int |
PDF_TEXT
|
protected int[][] |
PDF417_BITS
PDF417 bar patterns |
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 height 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. |
protected java.lang.String[][] |
textCodes
PDF417 text mode character set |
double |
topMarginCM
Top margin of the Barcode (also know as quiet zone). |
protected int |
topMarginPixels
|
boolean |
truncated
If true, truncated PDF417 code will be created; Default =False. |
int |
width
|
protected double |
widthBarCM
|
protected int |
widthBarPixels
|
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 | |
protected void |
addBar(java.awt.Graphics g,
int w,
boolean black,
int bartopmargin)
Adds a bar to the bar code at the currentX position. |
protected void |
addBarWithHeight(java.awt.Graphics g,
int w,
boolean black,
int Y,
int Height)
paint a bar |
protected void |
calculateSizes()
Calculates L and converts size in CM to pixels |
protected int |
findChar(java.lang.String[][] table,
java.lang.String c)
Finds a char in a charset table |
protected void |
genEC(int[] data,
int len)
Calculate the error correction/detection info; The first length elements of data are the data and padding, the next EClen elements are where we put the EC info. |
boolean |
getAutoSize()
Gets the autoSize property. |
java.awt.Color |
getBackground()
Gets the backColor property. |
java.lang.String |
getDataToEncode()
Gets the code property. |
java.awt.Color |
getForeground()
Gets the barColor property. |
double |
getLeftMarginCM()
Gets the leftMarginCM property. |
boolean |
getMacroPDFEnable()
Gets the MacroPDFEnable property. |
int |
getMacroPDFFileID()
Gets the MacroPDFFileID property. |
boolean |
getMacroPDFLastSegment()
Gets the MacroPDFLastSegment property. |
int |
getMacroPDFSegmentIndex()
Gets the MacroPDFSegmentIndex property. |
java.awt.Dimension |
getMinimumSize()
Gets the minimum size in pixels of the barcode image generated. |
int |
getPDFColumns()
Gets the PDFColumns property. |
int |
getPDFErrorCorrection()
Gets the PDFECLevel property. |
int |
getPDFMode()
Gets the PDFMode property. |
int |
getPDFRows()
Gets the PDFRows property. |
int |
getPixelsPerCM()
Gets the resolution property. |
java.awt.Dimension |
getPreferredSize()
Gets the size in pixels of the Preferred barcode image generated. |
boolean |
getProcessTilde()
Gets the processTilde property. |
int |
getRotationAngle()
Gets the rotate property. |
double |
getTopMarginCM()
Gets the topMarginCM property. |
boolean |
getTruncated()
Gets the truncated property. |
double |
getXDimensionCM()
Gets the X property. |
double |
getXtoYRatio()
Gets the XtoYRatio property. |
protected static double |
mod(double a,
double b)
|
void |
paint(java.awt.Graphics g2)
Paints the barcode and rotates it if necessary |
protected void |
paintBasis(java.awt.Graphics g)
Paints PDF417 |
protected void |
paintChar(java.awt.Graphics g,
java.lang.String patternColor,
java.lang.String patternBars)
Paints a character |
protected void |
paintChar2(java.awt.Graphics g,
java.lang.String patternColor,
java.lang.String patternBars,
int bartopmargin)
Paints a character |
protected void |
paintCharWithHeight(java.awt.Graphics g,
java.lang.String patternColor,
java.lang.String patternBars,
int Y,
int Height)
Paints a character/codeword |
protected void |
paintPDF417(java.awt.Graphics g)
Paints a PDF417 code |
protected int[] |
PDF417_compact_binary(byte[] bytes,
int datacols)
Convert a byte sequence to a sequence of codewords. |
protected int[] |
PDF417_compact_numeric(byte[] bytes,
int datacols)
Convert a digit sequence to a sequence of codewords. |
protected int[] |
PDF417_compact_text(byte[] bytes,
int datacols)
Converts a character sequence to a sequence of codewords; Pass the number of data columns to put in each row (between 1 and 30). |
protected java.awt.Image |
rotate(java.awt.Image im,
int angle,
int maxw,
int maxh)
rotates an image |
void |
setAutoSize(boolean newVal)
Sets the autoSize property. |
void |
setBackground(java.awt.Color newColor)
Sets the backColor property. |
void |
setDataToEncode(java.lang.String newCode)
Sets the code property. |
void |
setForeground(java.awt.Color newColor)
Sets the barColor property. |
void |
setImageSize(int imgWidth,
int imgHeight)
Sets the size of the generated image, if used then autoSize is set to false. |
void |
setLeftMarginCM(double newMargin)
Sets the leftMarginCM property. |
void |
setMacroPDFEnable(boolean Macro)
Sets the MacroPDFEnable property. |
void |
setMacroPDFFileID(int fileid)
Sets the MacroPDFFileID property. |
void |
setMacroPDFLastSegment(boolean Macro)
Sets the MacroPDFLastSegment property. |
void |
setMacroPDFSegmentIndex(int index)
Sets the MacroPDFSegmentIndex property. |
void |
setPDFColumns(int newColumns)
Sets the PDFColumns property. |
void |
setPDFErrorCorrection(int newEC)
Sets the PDFECLevel property. |
void |
setPDFMode(int newMode)
Sets the PDFMode property. |
void |
setPDFRows(int newRows)
Sets the PDFRows property. |
void |
setPixelsPerCM(int newRes)
Sets the resolution property. |
void |
setProcessTilde(boolean pt)
Sets the processTilde property. |
void |
setRotationAngle(int newRotate)
Sets the rotate property. |
void |
setTopMarginCM(double newMargin)
Sets the topMarginCM property. |
void |
setTruncated(boolean newVal)
Sets the truncated property. |
void |
setXDimensionCM(double newX)
Sets the X property. |
void |
setXtoYRatio(double newRatio)
Sets the XtoYRatio property. |
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, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, 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, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public byte[] binaryCode
public java.lang.String code
setDataToEncode(String newCode)
,
getDataToEncode()
,
User Manualpublic boolean processTilde
setProcessTilde(boolean pt)
,
getProcessTilde()
,
User Manualpublic double leftMarginCM
setLeftMarginCM(double newMargin)
,
getLeftMarginCM()
,
User Manualprotected static final int d
public double topMarginCM
setTopMarginCM(double newMargin)
,
getTopMarginCM()
,
User Manualprotected int leftMarginPixels
protected int topMarginPixels
public java.awt.Color backColor
setBackground(Color newColor)
,
getBackground()
,
User Manualprotected int narrowBarPixels
protected int widthBarPixels
protected double narrowBarCM
protected double widthBarCM
public boolean MacroPDFEnable
setMacroPDFEnable(boolean Macro)
,
getMacroPDFEnable()
,
User Manualpublic int MacroPDFSegmentIndex
setMacroPDFSegmentIndex(int index)
,
getMacroPDFSegmentIndex()
,
User Manualpublic int MacroPDFFileID
setMacroPDFFileID(int fileid)
,
getMacroPDFFileID()
,
User Manualpublic boolean MacroPDFLastSegment
setMacroPDFLastSegment(boolean Macro)
,
getMacroPDFLastSegment()
,
User Manualpublic int resolution
setPixelsPerCM(int newRes)
,
getPixelsPerCM()
,
User Manualprotected int barHeightPixels
public double N
public double X
setXDimensionCM(double newX)
,
getXDimensionCM()
,
User Manualpublic double XtoYRatio
setXtoYRatio(double newRatio)
,
getXtoYRatio()
,
User Manualpublic boolean truncated
setTruncated(boolean newVal)
,
getTruncated()
,
User Manualpublic int width
public int height
public int pWidth
getPreferredSize()
,
User Manualpublic int pHeight
getPreferredSize()
,
User Manualpublic boolean autoSize
setAutoSize(boolean newVal)
,
getAutoSize()
,
User Manualpublic java.awt.Color barColor
setForeground(Color newColor)
,
getForeground()
,
User Manualpublic double I
public double H
public double L
public int rotate
setRotationAngle(int newRotate)
,
getRotationAngle()
,
User Manualprotected java.lang.String[][] textCodes
protected int[][] coef
protected int[][] PDF417_BITS
public int PDFRows
setPDFRows(int newRows)
,
getPDFRows()
,
User Manualpublic int PDFColumns
setPDFColumns(int newColumns)
,
getPDFColumns()
,
User Manualpublic int PDFECLevel
setPDFErrorCorrection(int newEC)
,
getPDFErrorCorrection()
,
User Manualpublic static final int PDF_BINARY
public static final int PDF_TEXT
public static final int PDF_NUMERIC
public int PDFMode
setPDFMode(int newMode)
,
getPDFMode()
,
User Manualprotected int currentX
protected int currentY
Constructor Detail |
public PDF417()
Method Detail |
public void setDataToEncode(java.lang.String newCode)
newCode
- the new value for the code variable.code
,
User Manualpublic java.lang.String getDataToEncode()
code
,
User Manualpublic void setProcessTilde(boolean pt)
pt
- the new value for the processTilde variable.processTilde
,
User Manualpublic boolean getProcessTilde()
processTilde
,
User Manualpublic void setLeftMarginCM(double newMargin)
newMargin
- the new value for the leftMarginCM variable.leftMarginCM
,
User Manualpublic double getLeftMarginCM()
leftMarginCM
,
User Manualpublic void setTopMarginCM(double newMargin)
newMargin
- the new value for the topMarginCM variable.topMarginCM
,
User Manualpublic double getTopMarginCM()
topMarginCM
,
User Manualpublic void setBackground(java.awt.Color newColor)
newColor
- the new value for the backColor variable.backColor
,
User Manualpublic java.awt.Color getBackground()
backColor
,
User Manualpublic void setMacroPDFEnable(boolean Macro)
Macro
- the new value for the MacroPDFEnable variable.MacroPDFEnable
,
User Manualpublic boolean getMacroPDFEnable()
MacroPDFEnable
,
User Manualpublic void setMacroPDFSegmentIndex(int index)
index
- the new value for the MacroPDFSegmentIndex variable.MacroPDFSegmentIndex
,
User Manualpublic int getMacroPDFSegmentIndex()
MacroPDFSegmentIndex
,
User Manualpublic void setMacroPDFFileID(int fileid)
fileid
- the new value for the MacroPDFFileID variable.MacroPDFFileID
,
User Manualpublic int getMacroPDFFileID()
MacroPDFFileID
,
User Manualpublic void setMacroPDFLastSegment(boolean Macro)
Macro
- the new value for the MacroPDFLastSegment variable.MacroPDFLastSegment
,
User Manualpublic boolean getMacroPDFLastSegment()
MacroPDFLastSegment
,
User Manualpublic void setPixelsPerCM(int newRes)
newRes
- the new value for the resolution variable.resolution
,
User Manualpublic int getPixelsPerCM()
resolution
,
User Manualpublic void setXDimensionCM(double newX)
newX
- the new value for the X variable.X
,
User Manualpublic double getXDimensionCM()
X
,
User Manualpublic void setXtoYRatio(double newRatio)
newRatio
- the new value for the XtoYRatio variable.XtoYRatio
,
User Manualpublic double getXtoYRatio()
XtoYRatio
,
User Manualpublic void setTruncated(boolean newVal)
newVal
- the new value for the truncated variable.truncated
,
User Manualpublic boolean getTruncated()
truncated
,
User Manualpublic void setImageSize(int imgWidth, int imgHeight)
public void setAutoSize(boolean newVal)
newVal
- the new value for the autoSize variable.autoSize
,
User Manualpublic boolean getAutoSize()
autoSize
,
User Manualpublic java.awt.Dimension getPreferredSize()
pWidth
,
pHeight
,
User Manualpublic java.awt.Dimension getMinimumSize()
public void setForeground(java.awt.Color newColor)
newColor
- the new value for the barColor variable.barColor
,
User Manualpublic java.awt.Color getForeground()
barColor
,
User Manualpublic void setRotationAngle(int newRotate)
newRotate
- the new value for the rotate variable.rotate
,
User Manualpublic int getRotationAngle()
rotate
,
User Manualpublic void setPDFRows(int newRows)
newRows
- the new value for the PDFRows variable.PDFRows
,
User Manualpublic int getPDFRows()
PDFRows
,
User Manualpublic void setPDFColumns(int newColumns)
newColumns
- the new value for the PDFColumns variable.PDFColumns
,
User Manualpublic int getPDFColumns()
PDFColumns
,
User Manualpublic void setPDFErrorCorrection(int newEC)
newEC
- the new value for the PDFECLevel variable.PDFECLevel
,
User Manualpublic int getPDFErrorCorrection()
PDFECLevel
,
User Manualpublic void setPDFMode(int newMode)
newMode
- the new value for the PDFMode variable.PDFMode
,
User Manualpublic int getPDFMode()
PDFMode
,
User Manualprotected int findChar(java.lang.String[][] table, java.lang.String c)
protected static double mod(double a, double b)
protected void addBarWithHeight(java.awt.Graphics g, int w, boolean black, int Y, int Height)
protected void paintCharWithHeight(java.awt.Graphics g, java.lang.String patternColor, java.lang.String patternBars, int Y, int Height)
protected void paintPDF417(java.awt.Graphics g)
protected void paintBasis(java.awt.Graphics g)
protected int[] PDF417_compact_binary(byte[] bytes, int datacols)
protected int[] PDF417_compact_numeric(byte[] bytes, int datacols)
protected int[] PDF417_compact_text(byte[] bytes, int datacols)
protected void genEC(int[] data, int len)
protected void addBar(java.awt.Graphics g, int w, boolean black, int bartopmargin)
protected void paintChar(java.awt.Graphics g, java.lang.String patternColor, java.lang.String patternBars)
protected void paintChar2(java.awt.Graphics g, java.lang.String patternColor, java.lang.String patternBars, int bartopmargin)
protected void calculateSizes()
public void paint(java.awt.Graphics g2)
protected java.awt.Image rotate(java.awt.Image im, int angle, int maxw, int maxh)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |