Package com.itextpdf.text.pdf
Class PdfEncodings
- java.lang.Object
-
- com.itextpdf.text.pdf.PdfEncodings
-
public class PdfEncodings extends java.lang.ObjectSupports fast encodings for winansi and PDFDocEncoding. Supports conversions from CJK encodings to CID. Supports custom encodings.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classPdfEncodings.Cp437Conversionprivate static classPdfEncodings.SymbolConversionprivate static classPdfEncodings.SymbolTTConversionprivate static classPdfEncodings.WingdingsConversion
-
Field Summary
Fields Modifier and Type Field Description (package private) static java.util.HashMap<java.lang.String,ExtraEncoding>extraEncodings(package private) static IntHashtablepdfEncoding(package private) static char[]pdfEncodingByteToChar(package private) static IntHashtablewinansi(package private) static char[]winansiByteToChar
-
Constructor Summary
Constructors Constructor Description PdfEncodings()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidaddExtraEncoding(java.lang.String name, ExtraEncoding enc)Adds an extra encoding.static byte[]convertToBytes(char char1, java.lang.String encoding)Converts aStringto a byte array according to the font's encoding.static byte[]convertToBytes(java.lang.String text, java.lang.String encoding)Converts aStringto a byte array according to the font's encoding.static java.lang.StringconvertToString(byte[] bytes, java.lang.String encoding)Converts a byte array to aStringaccording to the some encoding.static booleanisPdfDocEncoding(java.lang.String text)Checks istextonly has PdfDocEncoding characters.
-
-
-
Field Detail
-
winansiByteToChar
static final char[] winansiByteToChar
-
pdfEncodingByteToChar
static final char[] pdfEncodingByteToChar
-
winansi
static final IntHashtable winansi
-
pdfEncoding
static final IntHashtable pdfEncoding
-
extraEncodings
static java.util.HashMap<java.lang.String,ExtraEncoding> extraEncodings
-
-
Method Detail
-
convertToBytes
public static final byte[] convertToBytes(java.lang.String text, java.lang.String encoding)Converts aStringto a byte array according to the font's encoding.- Parameters:
encoding- the encodingtext- theStringto be converted- Returns:
- an array of
byterepresenting the conversion according to the font's encoding
-
convertToBytes
public static final byte[] convertToBytes(char char1, java.lang.String encoding)Converts aStringto a byte array according to the font's encoding.- Parameters:
encoding- the encodingchar1- thecharto be converted- Returns:
- an array of
byterepresenting the conversion according to the font's encoding
-
convertToString
public static final java.lang.String convertToString(byte[] bytes, java.lang.String encoding)Converts a byte array to aStringaccording to the some encoding.- Parameters:
bytes- the bytes to convertencoding- the encoding- Returns:
- the converted
String
-
isPdfDocEncoding
public static boolean isPdfDocEncoding(java.lang.String text)
Checks istextonly has PdfDocEncoding characters.- Parameters:
text- theStringto test- Returns:
trueif only PdfDocEncoding characters are present
-
addExtraEncoding
public static void addExtraEncoding(java.lang.String name, ExtraEncoding enc)Adds an extra encoding.- Parameters:
name- the name of the encoding. The encoding recognition is case insensitiveenc- the conversion class
-
-