Class PdfChunk
java.lang.Object
com.itextpdf.text.pdf.PdfChunk
A
PdfChunk is the PDF translation of a Chunk.
A PdfChunk is a PdfString in a certain
PdfFont and BaseColor.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected IAccessibleElementMetric attributes.protected BaseFontprotected booleanIndicates if the height and offset of the Image has to be taken into accountprotected StringThe encoding.protected com.itextpdf.text.pdf.PdfFontThe font for thisPdfChunk.protected ImageThe image in thisPdfChunk, if it has oneprotected floatprotected floatThe leading that can overrule the existing leading.protected booleantrueif the chunk split was cause by a newline.Non metric attributes.protected floatThe offset in the x direction for the imageprotected floatThe offset in the y direction for the imageprotected SplitCharacterstatic final floatstatic final floatprotected StringThe value of this object. -
Method Summary
Modifier and TypeMethodDescriptionbooleanfloatReturns a scalePercentage in case the image needs to be scaled.floatfloatGets the text displacement relative to the baseline.intgetUnicodeEquivalent(int c) Gets the Unicode equivalent to a CID.floatgetWidthCorrected(float charSpacing, float wordSpacing) Gets the width of thePdfChunktaking into account the extra character and word spacing.protected intbooleanChecks if thePdfChunksplit was caused by a newline.static booleannoPrint(int c) voidsetImageScalePercentage(float imageScalePercentage) Sets a scale percentage in case the image needs to be scaled.toString()floatfloatTrims the last space.
-
Field Details
-
value
The value of this object. -
encoding
The encoding. -
font
protected com.itextpdf.text.pdf.PdfFont fontThe font for thisPdfChunk. -
baseFont
-
splitCharacter
-
attributes
-
noStroke
-
newlineSplit
protected boolean newlineSplittrueif the chunk split was cause by a newline. -
image
The image in thisPdfChunk, if it has one -
imageScalePercentage
protected float imageScalePercentage -
offsetX
protected float offsetXThe offset in the x direction for the image -
offsetY
protected float offsetYThe offset in the y direction for the image -
changeLeading
protected boolean changeLeadingIndicates if the height and offset of the Image has to be taken into account -
leading
protected float leadingThe leading that can overrule the existing leading. -
accessibleElement
-
UNDERLINE_THICKNESS
public static final float UNDERLINE_THICKNESS- See Also:
-
UNDERLINE_OFFSET
public static final float UNDERLINE_OFFSET- See Also:
-
-
Method Details
-
getUnicodeEquivalent
public int getUnicodeEquivalent(int c) Gets the Unicode equivalent to a CID. The (inexistent) CIDis translated as '\n'. It has only meaning with CJK fonts with Identity encoding. - Parameters:
c- the CID code- Returns:
- the Unicode equivalent
-
getWord
-
isNewlineSplit
public boolean isNewlineSplit()Checks if thePdfChunksplit was caused by a newline.- Returns:
trueif thePdfChunksplit was caused by a newline.
-
getWidthCorrected
public float getWidthCorrected(float charSpacing, float wordSpacing) Gets the width of thePdfChunktaking into account the extra character and word spacing.- Parameters:
charSpacing- the extra character spacingwordSpacing- the extra word spacing- Returns:
- the calculated width
-
getTextRise
public float getTextRise()Gets the text displacement relative to the baseline.- Returns:
- a displacement in points
-
trimLastSpace
public float trimLastSpace()Trims the last space.- Returns:
- the width of the space trimmed, otherwise 0
-
trimFirstSpace
public float trimFirstSpace() -
getImageScalePercentage
public float getImageScalePercentage()Returns a scalePercentage in case the image needs to be scaled.- Returns:
- the imageScalePercentage
-
setImageScalePercentage
public void setImageScalePercentage(float imageScalePercentage) Sets a scale percentage in case the image needs to be scaled.- Parameters:
imageScalePercentage- the imageScalePercentage to set
-
toString
-
changeLeading
public boolean changeLeading() -
getLeading
public float getLeading() -
noPrint
public static boolean noPrint(int c)
-