Class PDFDocEncoding
java.lang.Object
com.adobe.internal.pdftoolkit.core.util.PDFDocEncoding
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidconvertUTF16ToPDFDocEncoding(byte[] input, EncodedData<char[]> encInfo) Tries to convert the UTF-16 bytes passed to PDF Doc encoding.static char[]decode(byte[] bytes, int start, int length) PDFDocEncoding-encoded bytes to string conversion.static byte[]String to PDFDocEncoding-encoded bytes conversion.static voidencToUCSStrInternal(EncodedData<char[]> inputEncInfo, EncodedData<byte[]> outputEncInfo) This method converts PDF Doc encoded data to UCS format.static byte[]fromEscapeString(String str) Converts escaped string to a byte array.static byte[]fromUnicodeString(String uniStr) Converts a unicode string to byte array.static byte[]fromUnicodeString(String uniStr, boolean utf16) static booleanisPDFDocEncoding(String uniStr) static booleanReturns true if passed string represents unicode, else false.static StringtoAcrobatString(byte[] bytes) Converts byte array to same string format as Acrobat does.static StringtoAcrobatString(byte[] bytes, int start, int length) Converts byte array to same string format as Acrobat does.static StringtoEscapeString(byte[] bytes, int start, int length) Converts the byte array to escaped string.static StringtoUnicodeString(byte[] bytes) Converts byte array to unicode string.static StringtoUnicodeString(byte[] bytes, int start, int length) Make a Unicode string from a byte array
-
Method Details
-
toAcrobatString
Converts byte array to same string format as Acrobat does. -
toAcrobatString
Converts byte array to same string format as Acrobat does. -
toUnicodeString
Converts byte array to unicode string.- Throws:
PDFParseException
-
toUnicodeString
Make a Unicode string from a byte array- Throws:
PDFParseException
-
toEscapeString
Converts the byte array to escaped string. -
fromEscapeString
Converts escaped string to a byte array. -
fromUnicodeString
Converts a unicode string to byte array. -
fromUnicodeString
-
decode
PDFDocEncoding-encoded bytes to string conversion.- Throws:
CharacterCodingException- the byte stream is not a legal encoding.
-
encode
String to PDFDocEncoding-encoded bytes conversion.- Throws:
CharacterCodingException- the input string contains a characters which is not in PDFDocEncoding.
-
isUnicode
Returns true if passed string represents unicode, else false. -
isPDFDocEncoding
-
convertUTF16ToPDFDocEncoding
Tries to convert the UTF-16 bytes passed to PDF Doc encoding. This method copies the logic of ASTextGetPDTextCopy method in ASText.cpp file of Acrobat.- Parameters:
input-encInfo- This is the encoding information of the output.
-
encToUCSStrInternal
public static void encToUCSStrInternal(EncodedData<char[]> inputEncInfo, EncodedData<byte[]> outputEncInfo) This method converts PDF Doc encoded data to UCS format. Logic is copied from EncToUCSStrInternal method in PDConvrt.cpp file of Acrobat.- Parameters:
inputEncInfo-outputEncInfo-
-