|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.lowagie.text.Chunk
com.lowagie.text.pdf.PdfBarcode
public class PdfBarcode
A barcode is a Chunk with a certain type of barcode font.
With this class you can construct several types of barcode in different sizes, representing any 'product' or 'article' number.
| Field Summary | |
|---|---|
static int |
CODE39
This is a type of barcode. |
static int |
EAN13
This is a type of barcode. |
static int |
INTERLEAVED_2_OF_5
This is a type of barcode. |
static int |
UPCA
This is a type of barcode. |
static int[][] |
variableParity
The variable parity table in EAN 13 |
| Fields inherited from class com.lowagie.text.Chunk |
|---|
ACTION, attributes, BACKGROUND, COLOR, content, ENCODING, font, GENERICTAG, HSCALE, HYPHENATION, IMAGE, LOCALDESTINATION, LOCALGOTO, markupAttributes, NEWLINE, NEWPAGE, NEXTPAGE, OBJECT_REPLACEMENT_CHARACTER, PDFANNOTATION, REMOTEGOTO, SKEW, SPLITCHARACTER, SUBSUPSCRIPT, TEXTRENDERMODE, UNDERLINE |
| Fields inherited from interface com.lowagie.text.Element |
|---|
ALIGN_BASELINE, ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_JUSTIFIED, ALIGN_JUSTIFIED_ALL, ALIGN_LEFT, ALIGN_MIDDLE, ALIGN_RIGHT, ALIGN_TOP, ALIGN_UNDEFINED, ANCHOR, ANNOTATION, AUTHOR, CCITT_BLACKIS1, CCITT_ENCODEDBYTEALIGN, CCITT_ENDOFBLOCK, CCITT_ENDOFLINE, CCITTG3_1D, CCITTG3_2D, CCITTG4, CELL, CHAPTER, CHUNK, CREATIONDATE, CREATOR, GRAPHIC, HEADER, IMGRAW, IMGTEMPLATE, JPEG, KEYWORDS, LIST, LISTITEM, MULTI_COLUMN_TEXT, PARAGRAPH, PHRASE, PRODUCER, PTABLE, RECTANGLE, ROW, SECTION, SUBJECT, TABLE, TITLE |
| Constructor Summary | |
|---|---|
PdfBarcode(java.lang.String ttf,
int type,
int size,
long number)
Creates a new Barcode. |
|
PdfBarcode(java.lang.String ttf,
int type,
int size,
java.lang.String number)
Creates a new Barcode. |
|
| Method Summary | |
|---|---|
private static java.lang.String |
addZero(java.lang.String number,
int length)
Adds leading zeros. |
private static char |
convertInterleaved(int digits)
Converts an int to a convert interleaved character. |
private static java.lang.String |
convertToCode(int type,
java.lang.String number)
Converts a String representing a number to a barcode with a specific barcode font. |
| Methods inherited from class com.lowagie.text.Chunk |
|---|
addToArray, append, content, font, getAttributes, getChunks, getHorizontalScaling, getImage, getKeySet, getMarkupAttribute, getMarkupAttributeNames, getMarkupAttributes, getTextRise, getWidthPoint, hasAttributes, isEmpty, isTag, process, setAction, setAnchor, setAnchor, setAnnotation, setBackground, setBackground, setFont, setGenericTag, setHorizontalScaling, setHyphenation, setLocalDestination, setLocalGoto, setMarkupAttribute, setMarkupAttributes, setNewPage, setRemoteGoto, setRemoteGoto, setSkew, setSplitCharacter, setTextRenderMode, setTextRise, setUnderline, setUnderline, type |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.lowagie.text.Element |
|---|
toString |
| Field Detail |
|---|
public static final int CODE39
public static final int UPCA
public static final int EAN13
public static final int INTERLEAVED_2_OF_5
public static final int[][] variableParity
| Constructor Detail |
|---|
public PdfBarcode(java.lang.String ttf,
int type,
int size,
java.lang.String number)
throws BadElementException,
DocumentException,
java.io.IOException
ttf - the ttf file representing the barcode fontsize - the size of the barcodenumber - the number you want to convert to a barcode in String format
BadElementException
DocumentException
java.io.IOException
public PdfBarcode(java.lang.String ttf,
int type,
int size,
long number)
throws BadElementException,
DocumentException,
java.io.IOException
ttf - the ttf file representing the barcode fontsize - the size of the barcodenumber - the number you want to convert to a barcode in long format
BadElementException
DocumentException
java.io.IOException| Method Detail |
|---|
private static java.lang.String convertToCode(int type,
java.lang.String number)
throws BadElementException
type - the type of barcodenumber - the number you want to convert to a barcode in long format
BadElementException
private static char convertInterleaved(int digits)
throws java.lang.NumberFormatException
java.lang.NumberFormatException
private static java.lang.String addZero(java.lang.String number,
int length)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||