Class PdfChunk

java.lang.Object
com.lowagie.text.pdf.PdfChunk

@Deprecated public class PdfChunk extends Object
Deprecated.
A PdfChunk is the PDF translation of a Chunk.

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

See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected Map<String,Object>
    Deprecated.
    Metric attributes.
    protected BaseFont
    Deprecated.
     
    protected boolean
    Deprecated.
    Indicates if the height and offset of the Image has to be taken into account
    protected String
    Deprecated.
    The encoding.
    protected PdfFont
    Deprecated.
    The font for this PdfChunk.
    protected Image
    Deprecated.
    The image in this PdfChunk, if it has one
    private static final float
    Deprecated.
     
    private static final Map<String,Object>
    Deprecated.
    The allowed attributes in variable attributes.
    private static final Map<String,Object>
    Deprecated.
    The allowed attributes in variable noStroke.
    protected boolean
    Deprecated.
    true if the chunk split was cause by a newline.
    protected Map<String,Object>
    Deprecated.
    Non metric attributes.
    protected float
    Deprecated.
    The offset in the x direction for the image
    protected float
    Deprecated.
    The offset in the y direction for the image
    private static final char[]
    Deprecated.
     
    protected SplitCharacter
    Deprecated.
     
    private static final PdfChunk[]
    Deprecated.
     
    protected String
    Deprecated.
    The value of this object.
  • Constructor Summary

    Constructors
    Constructor
    Description
    PdfChunk(Chunk chunk, PdfAction action)
    Deprecated.
    Constructs a PdfChunk-object.
    PdfChunk(String string, PdfChunk other)
    Deprecated.
    Constructs a PdfChunk-object.
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) void
    adjustLeft(float newValue)
    Deprecated.
    Correction for the tab position based on the left starting position.
    boolean
    Deprecated.
     
    (package private) Color
    Deprecated.
    Returns the color of this Chunk.
    (package private) PdfFont
    Deprecated.
    Returns the font of this Chunk.
    (package private) Object
    Deprecated.
    Gets an attribute.
    (package private) float
    getCharWidth(int c)
    Deprecated.
     
    (package private) String
    Deprecated.
    Gets the encoding of this string.
    (package private) Image
    Deprecated.
    Gets the image in the PdfChunk.
    (package private) float
    Deprecated.
    Gets the image offset in the x direction
    (package private) float
    Deprecated.
    Gets the image offset in the y direction
    float
    Deprecated.
    Gets the text displacement relative to the baseline.
    int
    Deprecated.
    Gets the Unicode equivalent to a CID.
    float
    getWidthCorrected(float charSpacing, float wordSpacing)
    Deprecated.
    Gets the width of the PdfChunk taking into account the extra character and word spacing.
    protected int
    getWord(String text, int start)
    Deprecated.
     
    (package private) boolean
    Deprecated.
    Checks if the attribute exists.
    (package private) boolean
    isExtSplitCharacter(int start, int current, int end, char[] cc, PdfChunk[] ck)
    Deprecated.
     
    (package private) boolean
    Deprecated.
    Checks if this PdfChunk is a horizontal Separator Chunk.
    (package private) boolean
    Deprecated.
    Checks if there is an image in the PdfChunk.
    boolean
    Deprecated.
    Checks if the PdfChunk split was caused by a newline.
    (package private) boolean
    Deprecated.
    Checks if this PdfChunk is a Separator Chunk.
    (package private) boolean
    Deprecated.
    Tells you if this string is in Chinese, Japanese, Korean or Identity-H.
    (package private) boolean
    Deprecated.
    Checks if this PdfChunk needs some special metrics handling.
    (package private) boolean
    Deprecated.
    Checks if this PdfChunk is a tab Chunk.
    (package private) boolean
    Deprecated.
    Checks if this PdfChunk is a vertical Separator Chunk.
    (package private) int
    Deprecated.
     
    (package private) int
    Deprecated.
     
    static boolean
    noPrint(int c)
    Deprecated.
     
    (package private) void
    setImageOffsetX(float offsetX)
    Deprecated.
    Sets the image offset in the x direction
    (package private) void
    setImageOffsetY(float offsetY)
    Deprecated.
    Sets the image offset in the y direction
    (package private) void
    Deprecated.
    sets the value.
    (package private) PdfChunk
    split(float width)
    Deprecated.
    Splits this PdfChunk if it's too long for the given width.
    Deprecated.
     
    (package private) String
    trim(String string)
    Deprecated.
    Removes all the ' ' and '-'-characters on the right of a String.
    float
    Deprecated.
     
    float
    Deprecated.
    Trims the last space.
    (package private) PdfChunk
    truncate(float width)
    Deprecated.
    Truncates this PdfChunk if it's too long for the given width.
    (package private) float
    Deprecated.
    Returns the width of this PdfChunk.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • singleSpace

      private static final char[] singleSpace
      Deprecated.
    • thisChunk

      private static final PdfChunk[] thisChunk
      Deprecated.
    • ITALIC_ANGLE

      private static final float ITALIC_ANGLE
      Deprecated.
      See Also:
    • keysAttributes

      private static final Map<String,Object> keysAttributes
      Deprecated.
      The allowed attributes in variable attributes.
    • keysNoStroke

      private static final Map<String,Object> keysNoStroke
      Deprecated.
      The allowed attributes in variable noStroke.
    • value

      protected String value
      Deprecated.
      The value of this object.
    • encoding

      protected String encoding
      Deprecated.
      The encoding.
    • font

      protected PdfFont font
      Deprecated.
      The font for this PdfChunk.
    • baseFont

      protected BaseFont baseFont
      Deprecated.
    • splitCharacter

      protected SplitCharacter splitCharacter
      Deprecated.
    • attributes

      protected Map<String,Object> attributes
      Deprecated.
      Metric attributes.

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

    • noStroke

      protected Map<String,Object> noStroke
      Deprecated.
      Non metric attributes.

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

    • newlineSplit

      protected boolean newlineSplit
      Deprecated.
      true if the chunk split was cause by a newline.
    • image

      protected Image image
      Deprecated.
      The image in this PdfChunk, if it has one
    • offsetX

      protected float offsetX
      Deprecated.
      The offset in the x direction for the image
    • offsetY

      protected float offsetY
      Deprecated.
      The offset in the y direction for the image
    • changeLeading

      protected boolean changeLeading
      Deprecated.
      Indicates if the height and offset of the Image has to be taken into account
  • Constructor Details

    • PdfChunk

      PdfChunk(String string, PdfChunk other)
      Deprecated.
      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

      PdfChunk(Chunk chunk, PdfAction action)
      Deprecated.
      Constructs a PdfChunk-object.
      Parameters:
      chunk - the original Chunk-object
      action - the PdfAction if the Chunk comes from an Anchor
  • Method Details

    • noPrint

      public static boolean noPrint(int c)
      Deprecated.
    • getUnicodeEquivalent

      public int getUnicodeEquivalent(int c)
      Deprecated.
      Gets the Unicode equivalent to a CID. The (nonexistent) CID FF00 is translated as '\n'. It has only meaning with CJK fonts with Identity encoding.
      Parameters:
      c - the CID code
      Returns:
      the Unicode equivalent
    • getWord

      protected int getWord(String text, int start)
      Deprecated.
    • split

      PdfChunk split(float width)
      Deprecated.
      Splits this 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.
    • truncate

      PdfChunk truncate(float width)
      Deprecated.
      Truncates this 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.
    • font

      PdfFont font()
      Deprecated.
      Returns the font of this Chunk.
      Returns:
      a PdfFont
    • color

      Color color()
      Deprecated.
      Returns the color of this Chunk.
      Returns:
      a Color
    • width

      float width()
      Deprecated.
      Returns the width of this PdfChunk.
      Returns:
      a width
    • isNewlineSplit

      public boolean isNewlineSplit()
      Deprecated.
      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)
      Deprecated.
      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()
      Deprecated.
      Gets the text displacement relative to the baseline.
      Returns:
      a displacement in points
    • trimLastSpace

      public float trimLastSpace()
      Deprecated.
      Trims the last space.
      Returns:
      the width of the space trimmed, otherwise 0
    • trimFirstSpace

      public float trimFirstSpace()
      Deprecated.
    • getAttribute

      Object getAttribute(String name)
      Deprecated.
      Gets an attribute. The search is made in attributes and noStroke.
      Parameters:
      name - the attribute key
      Returns:
      the attribute value or null if not found
    • isAttribute

      boolean isAttribute(String name)
      Deprecated.
      Checks if the attribute exists.
      Parameters:
      name - the attribute key
      Returns:
      true if the attribute exists
    • isStroked

      boolean isStroked()
      Deprecated.
      Checks if this PdfChunk needs some special metrics handling.
      Returns:
      true if this PdfChunk needs some special metrics handling.
    • isSeparator

      boolean isSeparator()
      Deprecated.
      Checks if this PdfChunk is a Separator Chunk.
      Returns:
      true if this chunk is a separator.
      Since:
      2.1.2
    • isHorizontalSeparator

      boolean isHorizontalSeparator()
      Deprecated.
      Checks if this PdfChunk is a horizontal Separator Chunk.
      Returns:
      true if this chunk is a horizontal separator.
      Since:
      2.1.2
    • isVerticalSeparator

      boolean isVerticalSeparator()
      Deprecated.
      Checks if this PdfChunk is a vertical Separator Chunk.
      Returns:
      true if this chunk is a vertical separator.
      Since:
      OpenPDF
    • isTab

      boolean isTab()
      Deprecated.
      Checks if this PdfChunk is a tab Chunk.
      Returns:
      true if this chunk is a separator.
      Since:
      2.1.2
    • adjustLeft

      void adjustLeft(float newValue)
      Deprecated.
      Correction for the tab position based on the left starting position.
      Parameters:
      newValue - the new value for the left X.
      Since:
      2.1.2
    • isImage

      boolean isImage()
      Deprecated.
      Checks if there is an image in the PdfChunk.
      Returns:
      true if an image is present
    • getImage

      Image getImage()
      Deprecated.
      Gets the image in the PdfChunk.
      Returns:
      the image or null
    • getImageOffsetX

      float getImageOffsetX()
      Deprecated.
      Gets the image offset in the x direction
      Returns:
      the image offset in the x direction
    • setImageOffsetX

      void setImageOffsetX(float offsetX)
      Deprecated.
      Sets the image offset in the x direction
      Parameters:
      offsetX - the image offset in the x direction
    • getImageOffsetY

      float getImageOffsetY()
      Deprecated.
      Gets the image offset in the y direction
      Returns:
      Gets the image offset in the y direction
    • setImageOffsetY

      void setImageOffsetY(float offsetY)
      Deprecated.
      Sets the image offset in the y direction
      Parameters:
      offsetY - the image offset in the y direction
    • setValue

      void setValue(String value)
      Deprecated.
      sets the value.
      Parameters:
      value - content of the Chunk
    • toString

      public String toString()
      Deprecated.
      Overrides:
      toString in class Object
      See Also:
    • isSpecialEncoding

      boolean isSpecialEncoding()
      Deprecated.
      Tells you if this string is in Chinese, Japanese, Korean or Identity-H.
      Returns:
      true if the Chunk has a special encoding
    • getEncoding

      String getEncoding()
      Deprecated.
      Gets the encoding of this string.
      Returns:
      a String
    • length

      int length()
      Deprecated.
    • lengthUtf32

      int lengthUtf32()
      Deprecated.
    • isExtSplitCharacter

      boolean isExtSplitCharacter(int start, int current, int end, char[] cc, PdfChunk[] ck)
      Deprecated.
    • trim

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

      Parameters:
      string - the String that has to be trimmed.
      Returns:
      the trimmed String
    • changeLeading

      public boolean changeLeading()
      Deprecated.
    • getCharWidth

      float getCharWidth(int c)
      Deprecated.