content
This is the content of this chunk of text.
Element
, IAccessibleElement
TabbedChunk
Most elements can be divided in one or more Chunk
s. A chunk
is a String
with a certain Font
. All other
layout parameters should be defined in the object to which this chunk of text
is added.
Example:
Chunk chunk = new Chunk("Hello world", FontFactory.getFont(FontFactory.COURIER, 20, Font.ITALIC, new BaseColor(255, 0, 0))); document.add(chunk);
static final String
static final String
static final String
static final String
protected StringBuffer
private String
static final String
protected Font
Font
of this chunk of text.static final String
static final String
static final String
private AccessibleElementId
static final String
static final String
static final String
static final String
static final Chunk
static final String
static final Chunk
static final String
static final String
static final String
protected PdfName
static final String
static final String
static final Chunk
static final String
static final String
static final String
static final Chunk
static final String
static final String
static final String
static final String
static final String
ALIGN_BASELINE, ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_JUSTIFIED, ALIGN_JUSTIFIED_ALL, ALIGN_LEFT, ALIGN_MIDDLE, ALIGN_RIGHT, ALIGN_TOP, ALIGN_UNDEFINED, ANCHOR, ANNOTATION, AUTHOR, BODY, CCITT_BLACKIS1, CCITT_ENCODEDBYTEALIGN, CCITT_ENDOFBLOCK, CCITT_ENDOFLINE, CCITTG3_1D, CCITTG3_2D, CCITTG4, CHAPTER, CHUNK, CREATIONDATE, CREATOR, DIV, HEADER, IMGRAW, IMGTEMPLATE, JBIG2, JPEG, JPEG2000, KEYWORDS, LANGUAGE, LIST, LISTITEM, MARKED, PARAGRAPH, PHRASE, PRODUCER, PTABLE, RECTANGLE, SECTION, SUBJECT, TITLE, WRITABLE_DIRECT, YMARK
Chunk()
Chunk(char c)
Font
.
Font
.
Chunk
copy constructor.
Image
.
Image
.
Chunk(DrawInterface separator)
Chunk(DrawInterface separator,
boolean vertical)
Chunk(DrawInterface separator,
float tabPosition)
Chunk(DrawInterface separator,
float tabPosition,
boolean newline)
private
Font
.
Font
.Chunk
.static Chunk
static Chunk
createTabspace(float spacing)
static Chunk
createWhitespace(String content)
static Chunk
createWhitespace(String content,
boolean preserve)
A
dictionary + Lang
, Alt
, ActualText
, E
).Chunk
.float
Chunk
.getFont()
Chunk
.float
getId()
getImage()
getRole()
float
float
float
boolean
Chunk
.boolean
Chunk
.boolean
boolean
isEmpty()
Chunk
is empty.boolean
isInline()
boolean
boolean
boolean
boolean
process(ElementListener listener)
ElementListener
.void
setAccessibleAttribute(PdfName key,
PdfObject value)
A
dictionary + Lang
, Alt
, ActualText
, E
).Chunk
.Chunk
.Chunk
.setAnnotation(PdfAnnotation annotation)
Chunk
.private Chunk
setAttribute(String name,
Object obj)
void
setAttributes(HashMap<String,Object> attributes)
setBackground(BaseColor color)
Chunk
.setBackground(BaseColor color,
float extraLeft,
float extraBottom,
float extraRight,
float extraTop)
Chunk
.setCharacterSpacing(float charSpace)
void
Chunk
.setGenericTag(String text)
Chunk
.setHorizontalScaling(float scale)
setHyphenation(HyphenationEvent hyphenation)
Chunk
.void
setLineHeight(float lineheight)
setLocalDestination(String name)
Chunk
.setLocalGoto(String name)
Chunk
.setRemoteGoto(String filename,
int page)
Chunk
.setRemoteGoto(String filename,
String name)
Chunk
.void
setSkew(float alpha,
float beta)
setSplitCharacter(SplitCharacter splitCharacter)
void
setTextExpansion(String value)
setTextRenderMode(int mode,
float strokeWidth,
BaseColor strokeColor)
setTextRise(float rise)
setUnderline(float thickness,
float yPosition)
setUnderline(BaseColor color,
float thickness,
float thicknessMul,
float yPosition,
float yPositionMul,
int cap)
setWordSpacing(float wordSpace)
toString()
Chunk
.int
type()
Font
of this chunk of text.Chunk
copy constructor.ck
- the Chunk
to be copied
Font
.content
- the contentfont
- the fontFont
.content
- the contentFont
.c
- the contentfont
- the fontFont
.c
- the contentImage
.image
- the imageoffsetX
- the image offset in the x directionoffsetY
- the image offset in the y directionseparator
- the drawInterface to use to draw the separator.separator
- the drawInterface to use to draw the separator.vertical
- true if this is a vertical separatorseparator
- the drawInterface to use to draw the tab.tabPosition
- an X coordinate that will be used as start position for the next Chunk.separator
- the drawInterface to use to draw the tab.tabPosition
- an X coordinate that will be used as start position for the next Chunk.newline
- if true, a newline will be added if the tabPosition has already been reached.tabInterval
- an interval that will be used if tab stops are omitted.isWhitespace
- if true, the current tab is treated as white space.Image
.image
- the imageoffsetX
- the image offset in the x directionoffsetY
- the image offset in the y directionchangeLeading
- true if the leading has to be adapted to the image
ElementListener
.Chunk
.string
- String
StringBuffer
Chunk
.font
- a Font
Chunk
.Font
Chunk
.String
Chunk
.Chunk
is empty.false
if the Chunk contains other characters than
space.Chunk
.Chunk
.Chunk
.
It may be null.
Chunk
attributes
- the attributes of a Chunkname
- the key for the attributeobj
- the value of the attributeChunk
scale
- the horizontal scaling factorChunk
Chunk
width. Multiple call to this method will produce multiple
lines.thickness
- the absolute thickness of the lineyPosition
- the absolute y position relative to the baselineChunk
Chunk
width. Multiple call to this method will produce multiple
lines.color
- the color of the line or null
to follow the
text colorthickness
- the absolute thickness of the linethicknessMul
- the thickness multiplication factor with the font sizeyPosition
- the absolute y position relative to the baselineyPositionMul
- the position multiplication factor with the font sizecap
- the end line cap. Allowed values are
PdfContentByte.LINE_CAP_BUTT, PdfContentByte.LINE_CAP_ROUND
and PdfContentByte.LINE_CAP_PROJECTING_SQUAREChunk
It can be used to implement sub/superscript.
rise
- the displacement in pointsChunk
alpha=0
and beta=12
.alpha
- the first angle in degreesbeta
- the second angle in degreesChunk
Chunk
.color
- the color of the backgroundChunk
Chunk
.color
- the color of the backgroundextraLeft
- increase the size of the rectangle in the leftextraBottom
- increase the size of the rectangle in the bottomextraRight
- increase the size of the rectangle in the rightextraTop
- increase the size of the rectangle in the topChunk
mode
- the text rendering mode. It can be
PdfContentByte.TEXT_RENDER_MODE_FILL
,
PdfContentByte.TEXT_RENDER_MODE_STROKE
,
PdfContentByte.TEXT_RENDER_MODE_FILL_STROKE
and
PdfContentByte.TEXT_RENDER_MODE_INVISIBLE
.strokeWidth
- the stroke line width for the modes
PdfContentByte.TEXT_RENDER_MODE_STROKE
and
PdfContentByte.TEXT_RENDER_MODE_FILL_STROKE
.strokeColor
- the stroke color or null
to follow the text
colorChunk
splitCharacter
- the SplitCharacter
interfaceChunk
Chunk
.hyphenation
- the hyphenation engineChunk
Chunk
.filename
- the file name of the destination documentname
- the name of the destination to go toChunk
Chunk
.filename
- the file name of the destination documentpage
- the page of the destination to go to. First page is 1Chunk
Chunk
.
There must be a local destination matching the name.
name
- the name of the destination to go toChunk
Chunk
.name
- the name for this destinationChunk
Chunk
.
The text for this tag can be retrieved with PdfPageEvent
.
text
- the text for the tagChunk
Chunk
Chunk
.action
- the actionChunk
Chunk
.url
- the URL
to link toChunk
Chunk
.url
- the url to link toChunk
Chunk
Chunk
.annotation
- the annotationChunk
Element
Element
isNestable
in interface Element
charSpace
- the character spacing valueChunk
wordSpace
- the word spacing valueChunk
IAccessibleElement
A
dictionary + Lang
, Alt
, ActualText
, E
).getAccessibleAttribute
in interface IAccessibleElement
key
- IAccessibleElement
A
dictionary + Lang
, Alt
, ActualText
, E
).setAccessibleAttribute
in interface IAccessibleElement
key
- value
- IAccessibleElement
getAccessibleAttributes
in interface IAccessibleElement
IAccessibleElement
getRole
in interface IAccessibleElement
IAccessibleElement
null
if you don't want to tag this element.
Note that all child elements won't also be tagged.setRole
in interface IAccessibleElement
role
- getId
in interface IAccessibleElement
setId
in interface IAccessibleElement
isInline
in interface IAccessibleElement
value
-