Package com.itextpdf.io.font
Class PdfEncodings
java.lang.Object
com.itextpdf.io.font.PdfEncodings
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
A possible encoding.static final String
A possible encoding.static final String
A possible encoding.static final String
A possible encoding.static final String
The Unicode encoding with horizontal writing.static final String
The Unicode encoding with vertical writing.static final String
A possible encoding.static final String
This is the default encoding to be used for converting Strings into bytes and vice versa.static final String
A possible encoding.static final String
This is the encoding to be used to output text in Unicode.static final String
This is the encoding to be used to output text for Identity-H/V CMaps.static final String
static final String
A possible encoding.static final String
A possible encoding. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addExtraEncoding
(String name, IExtraEncoding enc) Adds an extra encoding.static byte[]
convertToBytes
(char ch, String encoding) Converts aString
to abyte
array according to the font's encoding.static byte[]
convertToBytes
(String text, String encoding) Converts aString
to abyte
array according to the font's encoding.static String
convertToString
(byte[] bytes, String encoding) Converts abyte
array to aString
according to the some encoding.static boolean
isPdfDocEncoding
(String text) Checks istext
only has PDF_DOC_ENCODING characters.
-
Field Details
-
IDENTITY_H
The Unicode encoding with horizontal writing.- See Also:
-
IDENTITY_V
The Unicode encoding with vertical writing.- See Also:
-
CP1250
A possible encoding.- See Also:
-
CP1252
A possible encoding.- See Also:
-
CP1253
A possible encoding.- See Also:
-
CP1257
A possible encoding.- See Also:
-
WINANSI
A possible encoding.- See Also:
-
MACROMAN
A possible encoding.- See Also:
-
SYMBOL
A possible encoding.- See Also:
-
ZAPFDINGBATS
A possible encoding.- See Also:
-
UNICODE_BIG
This is the encoding to be used to output text in Unicode.- See Also:
-
UNICODE_BIG_UNMARKED
This is the encoding to be used to output text for Identity-H/V CMaps.- See Also:
-
PDF_DOC_ENCODING
This is the default encoding to be used for converting Strings into bytes and vice versa. The default encoding is PDF_DOC_ENCODING.- See Also:
-
UTF8
- See Also:
-
-
Constructor Details
-
PdfEncodings
public PdfEncodings()
-
-
Method Details
-
convertToBytes
Converts aString
to abyte
array according to the font's encoding.- Parameters:
-
encoding
- the encoding -
text
- theString
to be converted - Returns:
-
an array of
byte
representing the conversion according to the font's encoding
-
convertToBytes
Converts aString
to abyte
array according to the font's encoding.- Parameters:
-
encoding
- the encoding -
ch
- thechar
to be converted - Returns:
-
an array of
byte
representing the conversion according to the font's encoding
-
convertToString
Converts abyte
array to aString
according to the some encoding.- Parameters:
-
bytes
- the bytes to convert -
encoding
- the encoding - Returns:
-
the converted
String
-
isPdfDocEncoding
Checks istext
only has PDF_DOC_ENCODING characters.- Parameters:
-
text
- theString
to test - Returns:
-
true
if only PDF_DOC_ENCODING characters are present
-
addExtraEncoding
Adds an extra encoding.- Parameters:
-
name
- the name of the encoding. The encoding recognition is case insensitive -
enc
- the conversion class
-