| java.lang.Object com.lowagie.text.pdf.PdfEncodings
PdfEncodings | public class PdfEncodings (Code) | | Supports fast encodings for winansi and PDFDocEncoding.
Supports conversions from CJK encodings to CID.
Supports custom encodings.
author: Paulo Soares (psoares@consiste.pt) |
Method Summary | |
public static void | addExtraEncoding(String name, ExtraEncoding enc) Adds an extra encoding.
Parameters: name - the name of the encoding. | static void | breakLong(long n, int size, byte seqs) | public static void | clearCmap(String name) Clears the CJK cmaps from the cache. | public static String | convertCmap(String name, byte seq) Converts a byte array encoded as name
to a CID string. | public static String | convertCmap(String name, byte seq, int start, int length) Converts a byte array encoded as name
to a CID string. | final public static byte[] | convertToBytes(String text, String encoding) Converts a String to a byte array according
to the font's encoding. | final public static byte[] | convertToBytes(char char1, String encoding) Converts a String to a byte array according
to the font's encoding. | final public static String | convertToString(byte bytes, String encoding) Converts a byte array to a String according
to the some encoding. | static String | decodeSequence(byte seq, int start, int length, char planes) | static void | encodeSequence(int size, byte seqs, char cid, ArrayList planes) | static void | encodeStream(InputStream in, ArrayList planes) | public static boolean | isPdfDocEncoding(String text) Checks is text only has PdfDocEncoding characters. | public static void | loadCmap(String name, byte newline) Loads a CJK cmap to the cache with the option of associating
sequences to the newline.
Parameters: name - the CJK cmap name Parameters: newline - the sequences to be replaced bi a newline in the resulting CID. | static char[][] | readCmap(String name, byte newline) | static void | readCmap(String name, ArrayList planes) |
CIDCHAR | final protected static int CIDCHAR(Code) | | |
CIDNONE | final protected static int CIDNONE(Code) | | |
CIDRANGE | final protected static int CIDRANGE(Code) | | |
CRLF_CID_NEWLINE | final public static byte CRLF_CID_NEWLINE(Code) | | Assumes that '\\n' and '\\r\\n' are the newline sequences. It may not work for
all CJK encodings. To be used with loadCmap().
|
pdfEncodingByteToChar | final static char pdfEncodingByteToChar(Code) | | |
winansiByteToChar | final static char winansiByteToChar(Code) | | |
addExtraEncoding | public static void addExtraEncoding(String name, ExtraEncoding enc)(Code) | | Adds an extra encoding.
Parameters: name - the name of the encoding. The encoding recognition is case insensitive Parameters: enc - the conversion class |
breakLong | static void breakLong(long n, int size, byte seqs)(Code) | | |
clearCmap | public static void clearCmap(String name)(Code) | | Clears the CJK cmaps from the cache. If name is the
empty string then all the cache is cleared. Calling this method
has no consequences other than the need to reload the cmap
if needed.
Parameters: name - the name of the cmap to clear or all the cmaps if the empty string |
convertCmap | public static String convertCmap(String name, byte seq)(Code) | | Converts a byte array encoded as name
to a CID string. This is needed to reach some CJK characters
that don't exist in 16 bit Unicode.
The font to use this result must use the encoding "Identity-H"
or "Identity-V".
See ftp://ftp.oreilly.com/pub/examples/nutshell/cjkv/adobe/.
Parameters: name - the CJK encoding name Parameters: seq - the byte array to be decoded the CID string |
convertCmap | public static String convertCmap(String name, byte seq, int start, int length)(Code) | | Converts a byte array encoded as name
to a CID string. This is needed to reach some CJK characters
that don't exist in 16 bit Unicode.
The font to use this result must use the encoding "Identity-H"
or "Identity-V".
See ftp://ftp.oreilly.com/pub/examples/nutshell/cjkv/adobe/.
Parameters: name - the CJK encoding name Parameters: start - the start offset in the data Parameters: length - the number of bytes to convert Parameters: seq - the byte array to be decoded the CID string |
convertToBytes | final public static byte[] convertToBytes(String text, String encoding)(Code) | | Converts a String to a byte array according
to the font's encoding.
an array of byte representing the conversion according to the font's encoding Parameters: encoding - the encoding Parameters: text - the String to be converted |
convertToBytes | final public static byte[] convertToBytes(char char1, String encoding)(Code) | | Converts a String to a byte array according
to the font's encoding.
an array of byte representing the conversion according to the font's encoding Parameters: encoding - the encoding Parameters: char1 - the char to be converted |
convertToString | final public static String convertToString(byte bytes, String encoding)(Code) | | Converts a byte array to a String according
to the some encoding.
Parameters: bytes - the bytes to convert Parameters: encoding - the encoding the converted String |
decodeSequence | static String decodeSequence(byte seq, int start, int length, char planes)(Code) | | |
encodeSequence | static void encodeSequence(int size, byte seqs, char cid, ArrayList planes)(Code) | | |
isPdfDocEncoding | public static boolean isPdfDocEncoding(String text)(Code) | | Checks is text only has PdfDocEncoding characters.
Parameters: text - the String to test true if only PdfDocEncoding characters are present |
loadCmap | public static void loadCmap(String name, byte newline)(Code) | | Loads a CJK cmap to the cache with the option of associating
sequences to the newline.
Parameters: name - the CJK cmap name Parameters: newline - the sequences to be replaced bi a newline in the resulting CID. See CRLF_CID_NEWLINE |
|
|