Class CMapContentParser

java.lang.Object
com.itextpdf.io.font.cmap.CMapContentParser

public class CMapContentParser extends Object
  • Field Details

    • COMMAND_TYPE

      public static final int COMMAND_TYPE
      Commands have this type.
      See Also:
  • Constructor Details

    • CMapContentParser

      public CMapContentParser (PdfTokenizer tokeniser)
      Creates a new instance of PdfContentParser
      Parameters:
      tokeniser - the tokeniser with the content
  • Method Details

    • parse

      public void parse (List<CMapObject> ls) throws IOException
      Parses a single command from the content. Each command is output as an array of arguments having the command itself as the last element. The returned array will be empty if the end of content was reached.
      Parameters:
      ls - an ArrayList to use. It will be cleared before using.
      Throws:
      IOException - on error
    • readDictionary

      public CMapObject readDictionary() throws IOException
      Reads a dictionary. The tokeniser must be positioned past the "<<" token.
      Returns:
      the dictionary
      Throws:
      IOException - on error
    • readArray

      public CMapObject readArray() throws IOException
      Reads an array. The tokeniser must be positioned past the "[" token.
      Returns:
      an array
      Throws:
      IOException - on error
    • readObject

      public CMapObject readObject() throws IOException
      Reads a pdf object.
      Returns:
      the pdf object
      Throws:
      IOException - on error
    • nextValidToken

      public boolean nextValidToken() throws IOException
      Reads the next token skipping over the comments.
      Returns:
      true if a token was read, false if the end of content was reached.
      Throws:
      IOException - on error.
    • toHex

      public static String toHex (int n)
      Gets an hex string in the format "".
      Parameters:
      n - the number
      Returns:
      the hex string
    • decodeCMapObject

      public static String decodeCMapObject (CMapObject cMapObject)