Class CMapContentParser
java.lang.Object
com.itextpdf.io.font.cmap.CMapContentParser
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intCommands have this type.private PdfTokenizerHolds value of property tokeniser. -
Constructor Summary
ConstructorsConstructorDescriptionCMapContentParser(PdfTokenizer tokeniser) Creates a new instance of PdfContentParser -
Method Summary
Modifier and TypeMethodDescriptionstatic StringdecodeCMapObject(CMapObject cMapObject) booleanReads the next token skipping over the comments.voidparse(List<CMapObject> ls) Parses a single command from the content.Reads an array.Reads a dictionary.Reads a pdf object.static StringtoHex(int n) Gets an hex string in the format "<HHHH>".private static StringtoHex4(int n)
-
Field Details
-
COMMAND_TYPE
public static final int COMMAND_TYPECommands have this type.- See Also:
-
tokeniser
Holds value of property tokeniser.
-
-
Constructor Details
-
CMapContentParser
Creates a new instance of PdfContentParser- Parameters:
tokeniser- the tokeniser with the content
-
-
Method Details
-
parse
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- anArrayListto use. It will be cleared before using.- Throws:
IOException- on error
-
readDictionary
Reads a dictionary. The tokeniser must be positioned past the"<<"token.- Returns:
- the dictionary
- Throws:
IOException- on error
-
readArray
Reads an array. The tokeniser must be positioned past the "[" token.- Returns:
- an array
- Throws:
IOException- on error
-
readObject
Reads a pdf object.- Returns:
- the pdf object
- Throws:
IOException- on error
-
nextValidToken
Reads the next token skipping over the comments.- Returns:
trueif a token was read,falseif the end of content was reached.- Throws:
IOException- on error.
-
toHex4
-
toHex
Gets an hex string in the format "<HHHH>".- Parameters:
n- the number- Returns:
- the hex string
-
decodeCMapObject
-