Class PdfEncodings
- Namespace
- iTextSharp.text.pdf
- Assembly
- iTextSharp.LGPLv2.Core.dll
Supports fast encodings for winansi and PDFDocEncoding. @author Paulo Soares (psoares@consiste.pt)
public static class PdfEncodings
- Inheritance
-
PdfEncodings
- Inherited Members
Fields
CrlfCidNewline
Assumes that '\n' and '\r\n' are the newline sequences. It may not work for all CJK encodings. To be used with LoadCmap().
public static byte[][] CrlfCidNewline
Field Value
- byte[][]
Methods
AddExtraEncoding(string, IExtraEncoding)
Adds an extra encoding.
public static void AddExtraEncoding(string name, IExtraEncoding enc)
Parameters
name
stringthe name of the encoding. The encoding recognition is case insensitive
enc
IExtraEncodingthe conversion class
ClearCmap(string)
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.
public static void ClearCmap(string name)
Parameters
name
stringthe name of the cmap to clear or all the cmaps if the empty string
ConvertCmap(string, byte[])
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/.
public static string ConvertCmap(string name, byte[] seq)
Parameters
Returns
- string
the CID string
ConvertCmap(string, byte[], int, int)
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/.
public static string ConvertCmap(string name, byte[] seq, int start, int length)
Parameters
name
stringthe CJK encoding name
seq
byte[]the byte array to be decoded
start
intthe start offset in the data
length
intthe number of bytes to convert
Returns
- string
the CID string
ConvertToBytes(char, string)
Converts a String to a byte array according to the font's encoding.
public static byte[] ConvertToBytes(char char1, string encoding)
Parameters
Returns
- byte[]
an array of byte representing the conversion according to the font's encoding
ConvertToBytes(string, string)
Converts a string to a byte array according to the font's encoding.
public static byte[] ConvertToBytes(string text, string encoding)
Parameters
Returns
- byte[]
an array of byte representing the conversion according to the font's encoding
ConvertToString(byte[], string)
public static string ConvertToString(byte[] bytes, string encoding)
Parameters
Returns
IsPdfDocEncoding(string)
Checks is text only has PdfDocEncoding characters.
public static bool IsPdfDocEncoding(string text)
Parameters
text
stringthe String to test
Returns
- bool
true if only PdfDocEncoding characters are present
LoadCmap(string, byte[][])
Loads a CJK cmap to the cache with the option of associating sequences to the newline.
public static void LoadCmap(string name, byte[][] newline)