public class PdfEncodings extends Object
Constructor and Description |
---|
PdfEncodings() |
Modifier and Type | Method and Description |
---|---|
static void |
addExtraEncoding(String name, ExtraEncoding enc)
Adds an extra encoding.
|
static byte[] |
convertToBytes(char char1, String encoding)
Converts a String to a byte array according to the font's encoding.
|
static byte[] |
convertToBytes(String text, String encoding)
Converts a String to a byte array according to the font's encoding.
|
static String |
convertToString(byte[] bytes, String encoding)
Converts a byte array to a String according to the some encoding.
|
static boolean |
isPdfDocEncoding(String text)
Checks is text only has PdfDocEncoding characters.
|
public static final byte[] convertToBytes(String text, String encoding)
String
to a byte array according to the font's encoding.
encoding
- the encoding
text
- the String
to be converted
byte
representing the conversion according to the font's encoding
public static final byte[] convertToBytes(char char1, String encoding)
String
to a byte array according to the font's encoding.
encoding
- the encoding
char1
- the char
to be converted
byte
representing the conversion according to the font's encoding
public static final String convertToString(byte[] bytes, String encoding)
String
according to the some encoding.
bytes
- the bytes to convert
encoding
- the encoding
String
public static boolean isPdfDocEncoding(String text)
text
only has PdfDocEncoding characters.
text
- the String
to test
true
if only PdfDocEncoding characters are present
public static void addExtraEncoding(String name, ExtraEncoding enc)
name
- the name of the encoding. The encoding recognition is case insensitive
enc
- the conversion class
Copyright © 1998–2022. All rights reserved.