com.lowagie.text.pdf
public class PdfChunk extends Object
PdfChunk
is the PDF translation of a Chunk
.
A PdfChunk
is a PdfString
in a certain
PdfFont
and Color
.
Field Summary | |
---|---|
protected HashMap | attributes
Metric attributes.
|
protected BaseFont | baseFont |
protected boolean | changeLeading Indicates if the height and offset of the Image has to be taken into account |
protected String | encoding The encoding. |
protected PdfFont | font The font for this PdfChunk . |
protected Image | image The image in this PdfChunk , if it has one |
static float | ITALIC_ANGLE |
static HashMap | keysAttributes The allowed attributes in variable attributes . |
static HashMap | keysNoStroke The allowed attributes in variable noStroke . |
protected boolean | newlineSplittrue if the chunk split was cause by a newline. |
protected HashMap | noStroke
Non metric attributes.
|
protected float | offsetX The offset in the x direction for the image |
protected float | offsetY The offset in the y direction for the image |
static char[] | singleSpace |
protected SplitCharacter | splitCharacter |
static PdfChunk[] | thisChunk |
protected String | value The value of this object. |
Constructor Summary | |
---|---|
PdfChunk(String string, PdfChunk other)
Constructs a PdfChunk -object.
| |
PdfChunk(Chunk chunk, PdfAction action)
Constructs a PdfChunk -object.
|
Method Summary | |
---|---|
void | adjustLeft(float newValue)
Correction for the tab position based on the left starting position. |
boolean | changeLeading() |
Color | color()
Returns the color of this Chunk .
|
PdfFont | font()
Returns the font of this Chunk .
|
Object | getAttribute(String name)
Gets an attribute. |
float | getCharWidth(int c) |
String | getEncoding()
Gets the encoding of this string.
|
Image | getImage()
Gets the image in the PdfChunk . |
float | getImageOffsetX()
Gets the image offset in the x direction |
float | getImageOffsetY()
Gets the image offset in the y direction |
float | getTextRise()
Gets the text displacement relative to the baseline. |
int | getUnicodeEquivalent(int c) Gets the Unicode equivalent to a CID.
|
float | getWidthCorrected(float charSpacing, float wordSpacing)
Gets the width of the PdfChunk taking into account the
extra character and word spacing. |
protected int | getWord(String text, int start) |
boolean | isAttribute(String name)
Checks if the attribute exists. |
boolean | isExtSplitCharacter(int start, int current, int end, char[] cc, PdfChunk[] ck) |
boolean | isHorizontalSeparator()
Checks if this PdfChunk is a horizontal Separator Chunk. |
boolean | isImage()
Checks if there is an image in the PdfChunk . |
boolean | isNewlineSplit()
Checks if the PdfChunk split was caused by a newline. |
boolean | isSeparator()
Checks if this PdfChunk is a Separator Chunk. |
boolean | isSpecialEncoding()
Tells you if this string is in Chinese, Japanese, Korean or Identity-H. |
boolean | isStroked()
Checks if this PdfChunk needs some special metrics handling. |
boolean | isTab()
Checks if this PdfChunk is a tab Chunk. |
int | length() |
int | lengthUtf32() |
static boolean | noPrint(int c) |
void | setImageOffsetX(float offsetX)
Sets the image offset in the x direction |
void | setImageOffsetY(float offsetY)
Sets the image offset in the y direction |
void | setValue(String value)
sets the value. |
PdfChunk | split(float width)
Splits this PdfChunk if it's too long for the given width.
|
String | toString() |
String | trim(String string)
Removes all the ' ' and '-'-characters on the right of a String .
|
float | trimFirstSpace() |
float | trimLastSpace()
Trims the last space. |
PdfChunk | truncate(float width)
Truncates this PdfChunk if it's too long for the given width.
|
float | width()
Returns the width of this PdfChunk .
|
This attributes require the measurement of characters widths when rendering such as underline.
PdfChunk
.PdfChunk
, if it has oneattributes
.noStroke
.true
if the chunk split was cause by a newline.This attributes do not require the measurement of characters widths when rendering such as Color.
PdfChunk
-object.
Parameters: string the content of the PdfChunk
-object other Chunk with the same style you want for the new Chunk
PdfChunk
-object.
Parameters: chunk the original Chunk
-object action the PdfAction
if the Chunk
comes from an Anchor
Parameters: newValue the new value for the left X.
Since: 2.1.2
Chunk
.
Returns: a Color
Chunk
.
Returns: a PdfFont
attributes
and noStroke
.Parameters: name the attribute key
Returns: the attribute value or null if not found
Returns: a String
PdfChunk
.Returns: the image or null
Returns: the image offset in the x direction
Returns: Gets the image offset in the y direction
Returns: a displacement in points
Parameters: c the CID code
Returns: the Unicode equivalent
PdfChunk
taking into account the
extra character and word spacing.Parameters: charSpacing the extra character spacing wordSpacing the extra word spacing
Returns: the calculated width
Parameters: name the attribute key
Returns: true
if the attribute exists
PdfChunk
is a horizontal Separator Chunk.Returns: true if this chunk is a horizontal separator.
Since: 2.1.2
PdfChunk
.Returns: true
if an image is present
PdfChunk
split was caused by a newline.Returns: true
if the PdfChunk
split was caused by a newline.
PdfChunk
is a Separator Chunk.Returns: true if this chunk is a separator.
Since: 2.1.2
Returns: true if the Chunk has a special encoding
PdfChunk
needs some special metrics handling.Returns: true
if this PdfChunk
needs some special metrics handling.
PdfChunk
is a tab Chunk.Returns: true if this chunk is a separator.
Since: 2.1.2
Parameters: offsetX the image offset in the x direction
Parameters: offsetY the image offset in the y direction
Parameters: value content of the Chunk
PdfChunk
if it's too long for the given width.
Returns null if the PdfChunk
wasn't truncated.
Parameters: width a given width
Returns: the PdfChunk
that doesn't fit into the width.
See Also: java.lang.Object#toString()
String
.
Parameters: string the String
that has to be trimmed.
Returns: the trimmed String
Returns: the width of the space trimmed, otherwise 0
PdfChunk
if it's too long for the given width.
Returns null if the PdfChunk
wasn't truncated.
Parameters: width a given width
Returns: the PdfChunk
that doesn't fit into the width.
PdfChunk
.
Returns: a width