public class PdfEncodings
extends java.lang.Object
Constructor | Description |
---|---|
PdfEncodings() |
Modifier and Type | Method | Description |
---|---|---|
static void |
addExtraEncoding(java.lang.String name,
ExtraEncoding enc) |
Adds an extra encoding.
|
static byte[] |
convertToBytes(char char1,
java.lang.String encoding) |
Converts a
String to a byte array according
to the font's encoding. |
static byte[] |
convertToBytes(java.lang.String text,
java.lang.String encoding) |
Converts a
String to a byte array according
to the font's encoding. |
static java.lang.String |
convertToString(byte[] bytes,
java.lang.String encoding) |
Converts a byte array to a
String according
to the some encoding. |
static boolean |
isPdfDocEncoding(java.lang.String text) |
Checks is
text only has PdfDocEncoding characters. |
public static final byte[] convertToBytes(java.lang.String text, java.lang.String encoding)
String
to a byte array according
to the font's encoding.encoding
- the encodingtext
- the String
to be convertedbyte
representing the conversion according to the font's encodingpublic static final byte[] convertToBytes(char char1, java.lang.String encoding)
String
to a byte array according
to the font's encoding.encoding
- the encodingchar1
- the char
to be convertedbyte
representing the conversion according to the font's encodingpublic static final java.lang.String convertToString(byte[] bytes, java.lang.String encoding)
String
according
to the some encoding.bytes
- the bytes to convertencoding
- the encodingString
public static boolean isPdfDocEncoding(java.lang.String text)
text
only has PdfDocEncoding characters.text
- the String
to testtrue
if only PdfDocEncoding characters are presentpublic static void addExtraEncoding(java.lang.String name, ExtraEncoding enc)
name
- the name of the encoding. The encoding recognition is case insensitiveenc
- the conversion classCopyright © 1998–2018. All rights reserved.