Package org.openpdf.text.pdf
Class PdfEncodings
java.lang.Object
org.openpdf.text.pdf.PdfEncodings
Supports fast encodings for winansi and PDFDocEncoding. Supports conversions from CJK encodings to CID. Supports
custom encodings.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddExtraEncoding(String name, ExtraEncoding enc) Adds an extra encoding.static final byte[]convertToBytes(char char1, String encoding) Converts aStringto abytearray according to the font's encoding.static final byte[]convertToBytes(String text, String encoding) Converts aStringto abytearray according to the font's encoding.static final StringconvertToString(byte[] bytes, String encoding) Converts abytearray to aStringaccording to the some encoding.static booleanisPdfDocEncoding(String text) Checks istextonly has PdfDocEncoding characters.
-
Constructor Details
-
PdfEncodings
public PdfEncodings()
-
-
Method Details
-
convertToBytes
Converts aStringto abytearray according to the font's encoding.- Parameters:
text- theStringto be convertedencoding- the encoding- Returns:
- an array of
byterepresenting the conversion according to the font's encoding
-
convertToBytes
Converts aStringto abytearray according to the font's encoding.- Parameters:
char1- thecharto be convertedencoding- the encoding- Returns:
- an array of
byterepresenting the conversion according to the font's encoding
-
convertToString
Converts abytearray to aStringaccording to the some encoding.- Parameters:
bytes- the bytes to convertencoding- the encoding- Returns:
- the converted
String
-
isPdfDocEncoding
Checks istextonly has PdfDocEncoding characters.- Parameters:
text- theStringto test- Returns:
trueif only PdfDocEncoding characters are present
-
addExtraEncoding
Adds an extra encoding.- Parameters:
name- the name of the encoding. The encoding recognition is case insensitiveenc- the conversion class
-