|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.lowagie.text.Chunk | +--com.lowagie.text.pdf.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, HYPHENATION, IMAGE, LOCALDESTINATION, LOCALGOTO, markupAttributes, NEWLINE, NEWPAGE, OBJECT_REPLACEMENT_CHARACTER, PDFANNOTATION, REMOTEGOTO, SKEW, SPLITCHARACTER, STRIKETHRU, SUBSUPSCRIPT, TEXTRENDERMODE, UNDERLINE |
Fields inherited from interface com.lowagie.text.Element |
ALIGN_BASELINE, ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_JUSTIFIED, 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, PARAGRAPH, PHRASE, PRODUCER, PTABLE, RECTANGLE, ROW, SECTION, SUBJECT, TABLE, TITLE |
Constructor Summary | |
PdfBarcode(String ttf,
int type,
int size,
long number)
Creates a new Barcode. |
|
PdfBarcode(String ttf,
int type,
int size,
String number)
Creates a new Barcode. |
Method Summary | |
private static String |
addZero(String number,
int length)
Adds leading zeros. |
private static char |
convertInterleaved(int digits)
Converts an int to a convert interleaved character. |
private static String |
convertToCode(int type,
String number)
Converts a String representing a number to a barcode with a specific barcode font. |
Methods inherited from class com.lowagie.text.Chunk |
append, content, font, getAttributes, getChunks, getImage, getKeySet, getMarkupAttribute, getMarkupAttributeNames, getMarkupAttributes, hasAttributes, isEmpty, isTag, process, setAction, setAnchor, setAnchor, setAnnotation, setBackground, setFont, setGenericTag, setHyphenation, setLocalDestination, setLocalGoto, setMarkupAttribute, setMarkupAttributes, setNewPage, setRemoteGoto, setRemoteGoto, setSkew, setSplitCharacter, setTextRenderMode, setTextRise, 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(String ttf, int type, int size, String number) throws BadElementException, DocumentException, 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 formatpublic PdfBarcode(String ttf, int type, int size, long number) throws BadElementException, DocumentException, 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 formatMethod Detail |
private static String convertToCode(int type, 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 NumberFormatException
NumberFormatException
private static String addZero(String number, int length)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |