Class CMapToUnicode
- java.lang.Object
-
- com.itextpdf.text.pdf.fonts.cmaps.AbstractCMap
-
- com.itextpdf.text.pdf.fonts.cmaps.CMapToUnicode
-
public class CMapToUnicode extends AbstractCMap
This class represents a CMap file.- Since:
- 2.1.4
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.Integer,java.lang.String>doubleByteMappingsprivate java.util.Map<java.lang.Integer,java.lang.String>singleByteMappings
-
Constructor Summary
Constructors Constructor Description CMapToUnicode()Creates a new instance of CMap.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidaddChar(int cid, java.lang.String uni)(package private) voidaddChar(PdfString mark, PdfObject code)private intconvertToInt(java.lang.String s)java.util.Map<java.lang.Integer,java.lang.Integer>createDirectMapping()java.util.Map<java.lang.Integer,java.lang.Integer>createReverseMapping()private java.lang.StringcreateStringFromBytes(byte[] bytes)static CMapToUnicodegetIdentity()booleanhasOneByteMappings()This will tell if this cmap has any one byte mappings.booleanhasTwoByteMappings()This will tell if this cmap has any two byte mappings.java.lang.Stringlookup(byte[] code, int offset, int length)This will perform a lookup into the map.-
Methods inherited from class com.itextpdf.text.pdf.fonts.cmaps.AbstractCMap
addRange, decodeStringToByte, decodeStringToUnicode, getName, getOrdering, getRegistry, getSupplement, setName, setOrdering, setRegistry, setSupplement
-
-
-
-
Method Detail
-
hasOneByteMappings
public boolean hasOneByteMappings()
This will tell if this cmap has any one byte mappings.- Returns:
- true If there are any one byte mappings, false otherwise.
-
hasTwoByteMappings
public boolean hasTwoByteMappings()
This will tell if this cmap has any two byte mappings.- Returns:
- true If there are any two byte mappings, false otherwise.
-
lookup
public java.lang.String lookup(byte[] code, int offset, int length)This will perform a lookup into the map.- Parameters:
code- The code used to lookup.offset- The offset into the byte array.length- The length of the data we are getting.- Returns:
- The string that matches the lookup.
-
createReverseMapping
public java.util.Map<java.lang.Integer,java.lang.Integer> createReverseMapping() throws java.io.IOException- Throws:
java.io.IOException
-
createDirectMapping
public java.util.Map<java.lang.Integer,java.lang.Integer> createDirectMapping() throws java.io.IOException- Throws:
java.io.IOException
-
convertToInt
private int convertToInt(java.lang.String s) throws java.io.IOException- Throws:
java.io.IOException
-
addChar
void addChar(int cid, java.lang.String uni)
-
addChar
void addChar(PdfString mark, PdfObject code)
- Specified by:
addCharin classAbstractCMap
-
createStringFromBytes
private java.lang.String createStringFromBytes(byte[] bytes) throws java.io.IOException- Throws:
java.io.IOException
-
getIdentity
public static CMapToUnicode getIdentity()
-
-