com.lowagie.text

Interface Element

public interface Element

Interface for a text element.

Remark: I looked at the interface javax.swing.text.Element, but I decided to write my own text-classes for two reasons:

  1. The javax.swing.text-classes may be very generic, I think they are overkill: they are to heavy for what they have to do.
  2. A lot of people using iText (formerly known as rugPdf), still use JDK1.1.x. I try to keep the Java2 requirements limited to the Collection classes (I think they're really great). However, if I use the javax.swing.text classes, it will become very difficult to downgrade rugPdf.

See Also: Anchor Cell Chapter Chunk Header Image Jpeg List ListItem Meta Paragraph Phrase Rectangle Row Section Table

Field Summary
static intALIGN_BASELINE
A possible value for vertical alignment.
static intALIGN_BOTTOM
A possible value for vertical alignment.
static intALIGN_CENTER
A possible value for paragraph alignment.
static intALIGN_JUSTIFIED
A possible value for paragraph alignment.
static intALIGN_JUSTIFIED_ALL
Does the same as ALIGN_JUSTIFIED but the last line is also spread out.
static intALIGN_LEFT
A possible value for paragraph alignment.
static intALIGN_MIDDLE
A possible value for vertical alignment.
static intALIGN_RIGHT
A possible value for paragraph alignment.
static intALIGN_TOP
A possible value for vertical alignment.
static intALIGN_UNDEFINED
A possible value for paragraph alignment.
static intANCHOR
This is a possible type of Element
static intANNOTATION
This is a possible type of Element.
static intAUTHOR
This is a possible type of Element .
static intCCITTG3_1D
Pure one-dimensional encoding (Group 3, 1-D)
static intCCITTG3_2D
Mixed one- and two-dimensional encoding (Group 3, 2-D)
static intCCITTG4
Pure two-dimensional encoding (Group 4)
static intCCITT_BLACKIS1
A flag indicating whether 1-bits are to be interpreted as black pixels and 0-bits as white pixels,
static intCCITT_ENCODEDBYTEALIGN
A flag indicating whether the filter expects extra 0-bits before each encoded line so that the line begins on a byte boundary.
static intCCITT_ENDOFBLOCK
A flag indicating whether the filter expects the encoded data to be terminated by an end-of-block pattern, overriding the Rows parameter.
static intCCITT_ENDOFLINE
A flag indicating whether end-of-line bit patterns are required to be present in the encoding.
static intCELL
This is a possible type of Element.
static intCHAPTER
This is a possible type of Element
static intCHUNK
This is a possible type of Element.
static intCREATIONDATE
This is a possible type of Element .
static intCREATOR
This is a possible type of Element .
static intHEADER
This is a possible type of Element.
static intIMGRAW
This is a possible type of Element.
static intIMGTEMPLATE
This is a possible type of Element.
static intJPEG
This is a possible type of Element.
static intKEYWORDS
This is a possible type of Element.
static intLIST
This is a possible type of Element
static intLISTITEM
This is a possible type of Element
static intMARKED
This is a possible type of Element.
static intMULTI_COLUMN_TEXT
This is a possible type of Element.
static intPARAGRAPH
This is a possible type of Element.
static intPHRASE
This is a possible type of Element.
static intPRODUCER
This is a possible type of Element .
static intPTABLE
This is a possible type of Element.
static intRECTANGLE
This is a possible type of Element.
static intROW
This is a possible type of Element.
static intSECTION
This is a possible type of Element
static intSUBJECT
This is a possible type of Element.
static intTABLE
This is a possible type of Element.
static intTITLE
This is a possible type of Element.
Method Summary
ArrayListgetChunks()
Gets all the chunks in this element.
booleanprocess(ElementListener listener)
Processes the element by adding it (or the different parts) to an ElementListener.
StringtoString()
Gets the content of the text element.
inttype()
Gets the type of the text element.

Field Detail

ALIGN_BASELINE

public static final int ALIGN_BASELINE
A possible value for vertical alignment.

ALIGN_BOTTOM

public static final int ALIGN_BOTTOM
A possible value for vertical alignment.

ALIGN_CENTER

public static final int ALIGN_CENTER
A possible value for paragraph alignment. This specifies that the text is aligned to the center and extra whitespace should be placed equally on the left and right.

ALIGN_JUSTIFIED

public static final int ALIGN_JUSTIFIED
A possible value for paragraph alignment. This specifies that extra whitespace should be spread out through the rows of the paragraph with the text lined up with the left and right indent except on the last line which should be aligned to the left.

ALIGN_JUSTIFIED_ALL

public static final int ALIGN_JUSTIFIED_ALL
Does the same as ALIGN_JUSTIFIED but the last line is also spread out.

ALIGN_LEFT

public static final int ALIGN_LEFT
A possible value for paragraph alignment. This specifies that the text is aligned to the left indent and extra whitespace should be placed on the right.

ALIGN_MIDDLE

public static final int ALIGN_MIDDLE
A possible value for vertical alignment.

ALIGN_RIGHT

public static final int ALIGN_RIGHT
A possible value for paragraph alignment. This specifies that the text is aligned to the right indent and extra whitespace should be placed on the left.

ALIGN_TOP

public static final int ALIGN_TOP
A possible value for vertical alignment.

ALIGN_UNDEFINED

public static final int ALIGN_UNDEFINED
A possible value for paragraph alignment. This specifies that the text is aligned to the left indent and extra whitespace should be placed on the right.

ANCHOR

public static final int ANCHOR
This is a possible type of Element

ANNOTATION

public static final int ANNOTATION
This is a possible type of Element.

AUTHOR

public static final int AUTHOR
This is a possible type of Element .

CCITTG3_1D

public static final int CCITTG3_1D
Pure one-dimensional encoding (Group 3, 1-D)

CCITTG3_2D

public static final int CCITTG3_2D
Mixed one- and two-dimensional encoding (Group 3, 2-D)

CCITTG4

public static final int CCITTG4
Pure two-dimensional encoding (Group 4)

CCITT_BLACKIS1

public static final int CCITT_BLACKIS1
A flag indicating whether 1-bits are to be interpreted as black pixels and 0-bits as white pixels,

CCITT_ENCODEDBYTEALIGN

public static final int CCITT_ENCODEDBYTEALIGN
A flag indicating whether the filter expects extra 0-bits before each encoded line so that the line begins on a byte boundary.

CCITT_ENDOFBLOCK

public static final int CCITT_ENDOFBLOCK
A flag indicating whether the filter expects the encoded data to be terminated by an end-of-block pattern, overriding the Rows parameter. The use of this flag will set the key /EndOfBlock to false.

CCITT_ENDOFLINE

public static final int CCITT_ENDOFLINE
A flag indicating whether end-of-line bit patterns are required to be present in the encoding.

CELL

public static final int CELL
This is a possible type of Element.

CHAPTER

public static final int CHAPTER
This is a possible type of Element

CHUNK

public static final int CHUNK
This is a possible type of Element.

CREATIONDATE

public static final int CREATIONDATE
This is a possible type of Element .

CREATOR

public static final int CREATOR
This is a possible type of Element .

HEADER

public static final int HEADER
This is a possible type of Element.

IMGRAW

public static final int IMGRAW
This is a possible type of Element.

IMGTEMPLATE

public static final int IMGTEMPLATE
This is a possible type of Element.

JPEG

public static final int JPEG
This is a possible type of Element.

KEYWORDS

public static final int KEYWORDS
This is a possible type of Element.

LIST

public static final int LIST
This is a possible type of Element

LISTITEM

public static final int LISTITEM
This is a possible type of Element

MARKED

public static final int MARKED
This is a possible type of Element.

MULTI_COLUMN_TEXT

public static final int MULTI_COLUMN_TEXT
This is a possible type of Element.

PARAGRAPH

public static final int PARAGRAPH
This is a possible type of Element.

PHRASE

public static final int PHRASE
This is a possible type of Element.

PRODUCER

public static final int PRODUCER
This is a possible type of Element .

PTABLE

public static final int PTABLE
This is a possible type of Element.

RECTANGLE

public static final int RECTANGLE
This is a possible type of Element.

ROW

public static final int ROW
This is a possible type of Element.

SECTION

public static final int SECTION
This is a possible type of Element

SUBJECT

public static final int SUBJECT
This is a possible type of Element.

TABLE

public static final int TABLE
This is a possible type of Element.

TITLE

public static final int TITLE
This is a possible type of Element.

Method Detail

getChunks

public ArrayList getChunks()
Gets all the chunks in this element.

Returns: an ArrayList

process

public boolean process(ElementListener listener)
Processes the element by adding it (or the different parts) to an ElementListener.

Parameters: listener an ElementListener

Returns: true if the element was processed successfully

toString

public String toString()
Gets the content of the text element.

Returns: a type

type

public int type()
Gets the type of the text element.

Returns: a type