com.lowagie.text.pdf
Class PdfChunk

java.lang.Object
  extended bycom.lowagie.text.pdf.PdfChunk

public class PdfChunk
extends Object

A PdfChunk is the PDF translation of a Chunk.

A PdfChunk is a PdfString in a certain PdfFont and Color.

See Also:
PdfString, Chunk, Font

Method Summary
 boolean changeLeading()
           
 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.
 boolean isNewlineSplit()
          Checks if the PdfChunk split was caused by a newline.
static boolean noPrint(int c)
           
 String toString()
           
 float trimFirstSpace()
           
 float trimLastSpace()
          Trims the last space.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getUnicodeEquivalent

public int getUnicodeEquivalent(int c)
Gets the Unicode equivalent to a CID. The (inexistent) CID is translated as '\n'. It has only meaning with CJK fonts with Identity encoding.

Parameters:
c - the CID code
Returns:
the Unicode equivalent

isNewlineSplit

public boolean isNewlineSplit()
Checks if the PdfChunk split was caused by a newline.

Returns:
true if the PdfChunk split was caused by a newline.

getWidthCorrected

public float getWidthCorrected(float charSpacing,
                               float wordSpacing)
Gets the width of the 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

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()

toString

public String toString()
See Also:
Object.toString()

changeLeading

public boolean changeLeading()

noPrint

public static boolean noPrint(int c)


Copyright © 2011 EGIZ - E-Government Innovation Center. All Rights Reserved.