Class CMapEncoding

java.lang.Object
com.itextpdf.io.font.CMapEncoding

public class CMapEncoding extends Object
Class representing CMap encoding in pdf document.
  • Constructor Details

    • CMapEncoding

      public CMapEncoding (String cmap)
      Creates a new CMap encoding.
      Parameters:
      cmap - CMap name
    • CMapEncoding

      public CMapEncoding (String cmap, String uniMap)
      Creates a new CMap encoding.
      Parameters:
      cmap - CMap name
      uniMap - CMap to convert Unicode value to CID
    • CMapEncoding

      public CMapEncoding (String cmap, byte[] cmapBytes)
      Creates a new CMap encoding.
      Parameters:
      cmap - CMap name
      cmapBytes - CMap binary data
  • Method Details

    • isDirect

      public boolean isDirect()
      Checks if CMap is direct or indirect pdf object
      Returns:
      true if direct, false otherwise
    • hasUniMap

      public boolean hasUniMap()
      Checks if CMap to convert Unicode value to CID is present.
      Returns:
      true if present, false otherwise
    • getRegistry

      public String getRegistry()
      Gets string identifying the issuer of the character collection.
      Returns:
      name of the issuer
    • getOrdering

      public String getOrdering()
      Gets string that uniquely names the character collection within the specified registry.
      Returns:
      character collection name
    • getSupplement

      public int getSupplement()
      Gets the supplement number of the character collection
      Returns:
      supplement number
    • getUniMapName

      public String getUniMapName()
      Gets CMap name which converts Unicode value to CID.
      Returns:
      CMap name
    • getCmapName

      public String getCmapName()
      Gets CMap name.
      Returns:
      CMap name
    • isBuiltWith

      public boolean isBuiltWith (String cmap)
      Checks whether the CMapEncoding was built with corresponding cmap name.
      Parameters:
      cmap - a CMAP
      Returns:
      true, if the CMapEncoding was built with the cmap, false otherwise.
    • getCmapBytes

      public byte[] getCmapBytes (int cid)
      Gets CMap bytes by CID.
      Parameters:
      cid - id of the CMap
      Returns:
      cmap as byte array
    • fillCmapBytes

      public int fillCmapBytes (int cid, byte[] array, int offset)
      Encodes a CID into the supplied byte array.
      Parameters:
      cid - character identifier to encode
      array - destination array
      offset - destination offset
      Returns:
      new destination offset
    • fillCmapBytes

      public void fillCmapBytes (int cid, ByteBuffer buffer)
      Appends the encoded form of a CID to a byte buffer.
      Parameters:
      cid - character identifier to encode
      buffer - destination buffer
    • getCmapBytesLength

      public int getCmapBytesLength (int cid)
      Gets the number of bytes required to encode a CID.
      Parameters:
      cid - character identifier to encode
      Returns:
      number of bytes required to encode a CID
    • getCidCode

      public int getCidCode (int cmapCode)
      Converts a CMap code to its CID.
      Parameters:
      cmapCode - CMap code
      Returns:
      mapped CID
    • getCodeSpaceRanges

      public List getCodeSpaceRanges()
      Gets the CMap code space ranges.
      Returns:
      list of low/high byte array pairs used by this encoding