Save This Page
Home » iText-src-2.1.3 » com.lowagie » text » pdf » [javadoc | source]
com.lowagie.text.pdf
public class: PdfChunk [javadoc | source]
java.lang.Object
   com.lowagie.text.pdf.PdfChunk
A PdfChunk is the PDF translation of a Chunk.

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

Field Summary
protected  String value    The value of this object. 
protected  String encoding    The encoding. 
protected  PdfFont font    The font for this PdfChunk
protected  BaseFont baseFont     
protected  SplitCharacter splitCharacter     
protected  HashMap attributes    Metric attributes.

This attributes require the measurement of characters widths when rendering such as underline. 

protected  HashMap noStroke    Non metric attributes.

This attributes do not require the measurement of characters widths when rendering such as Color. 

protected  boolean newlineSplit    true if the chunk split was cause by a newline. 
protected  Image image    The image in this PdfChunk, if it has one 
protected  float offsetX    The offset in the x direction for the image 
protected  float offsetY    The offset in the y direction for the image 
protected  boolean changeLeading    Indicates if the height and offset of the Image has to be taken into account 
Constructor:
 PdfChunk(String string,
    PdfChunk other) 
    Constructs a PdfChunk-object.
    Parameters:
    string - the content of the PdfChunk-object
    other - Chunk with the same style you want for the new Chunk
 PdfChunk(Chunk chunk,
    PdfAction action) 
    Constructs a PdfChunk-object.
    Parameters:
    chunk - the original Chunk-object
    action - the PdfAction if the Chunk comes from an Anchor
Method from com.lowagie.text.pdf.PdfChunk Summary:
adjustLeft,   changeLeading,   color,   font,   getAttribute,   getCharWidth,   getEncoding,   getImage,   getImageOffsetX,   getImageOffsetY,   getTextRise,   getUnicodeEquivalent,   getWidthCorrected,   getWord,   isAttribute,   isExtSplitCharacter,   isHorizontalSeparator,   isImage,   isNewlineSplit,   isSeparator,   isSpecialEncoding,   isStroked,   isTab,   length,   lengthUtf32,   noPrint,   setImageOffsetX,   setImageOffsetY,   setValue,   split,   toString,   trim,   trimFirstSpace,   trimLastSpace,   truncate,   width
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from com.lowagie.text.pdf.PdfChunk Detail:
  void adjustLeft(float newValue) 
    Correction for the tab position based on the left starting position.
 public 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. The search is made in attributes and noStroke.
 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
 public float getTextRise() 
    Gets the text displacement relative to the baseline.
 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.
 public 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.
 public 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() 
 public 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.

    Returns null if the PdfChunk wasn't truncated.

 public String toString() 
 String trim(String string) 
    Removes all the ' ' and '-'-characters on the right of a String.

 public float trimFirstSpace() 
 public float trimLastSpace() 
    Trims the last space.
 PdfChunk truncate(float width) 
    Truncates this PdfChunk if it's too long for the given width.

    Returns null if the PdfChunk wasn't truncated.

 float width() 
    Returns the width of this PdfChunk.