HiraokaHyperTools.iTextSharp-LGPL  0.2.5
iTextSharp.text.pdf.PdfEncodings Class Reference

Static Public Member Functions

static byte[] ConvertToBytes (string text, string encoding)
 
static byte[] ConvertToBytes (char char1, String encoding)
 
static string ConvertToString (byte[] bytes, string encoding)
 
static bool IsPdfDocEncoding (String text)
 
static void ClearCmap (String name)
 
static void LoadCmap (String name, byte[][] newline)
 
static String ConvertCmap (String name, byte[] seq)
 
static String ConvertCmap (String name, byte[] seq, int start, int length)
 
static void AddExtraEncoding (String name, IExtraEncoding enc)
 

Static Public Attributes

static byte[][] CRLF_CID_NEWLINE = new byte[][]{new byte[]{(byte)'\n'}, new byte[]{(byte)'\r', (byte)'\n'}}
 

Static Protected Attributes

const int CIDNONE = 0
 
const int CIDRANGE = 1
 
const int CIDCHAR = 2
 

Detailed Description

Supports fast encodings for winansi and PDFDocEncoding.

Author
Paulo Soares (psoar.nosp@m.es@c.nosp@m.onsis.nosp@m.te.p.nosp@m.t)

Member Function Documentation

◆ AddExtraEncoding()

static void iTextSharp.text.pdf.PdfEncodings.AddExtraEncoding ( String  name,
IExtraEncoding  enc 
)
static

Adds an extra encoding.

Parameters
namethe name of the encoding. The encoding recognition is case insensitive
encthe conversion class

◆ ClearCmap()

static void iTextSharp.text.pdf.PdfEncodings.ClearCmap ( String  name)
static

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
namethe name of the cmap to clear or all the cmaps if the empty string

◆ ConvertCmap() [1/2]

static String iTextSharp.text.pdf.PdfEncodings.ConvertCmap ( String  name,
byte[]  seq 
)
static

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
namethe CJK encoding name
seqthe byte array to be decoded
Returns
the CID string

◆ ConvertCmap() [2/2]

static String iTextSharp.text.pdf.PdfEncodings.ConvertCmap ( String  name,
byte[]  seq,
int  start,
int  length 
)
static

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
namethe CJK encoding name
startthe start offset in the data
lengththe number of bytes to convert
seqthe byte array to be decoded
Returns
the CID string

◆ ConvertToBytes() [1/2]

static byte [] iTextSharp.text.pdf.PdfEncodings.ConvertToBytes ( char  char1,
String  encoding 
)
static

Converts a String to a byte array according to the font's encoding.

Returns
an array of byte representing the conversion according to the font's encoding
Parameters
encodingthe encoding
char1the char to be converted

◆ ConvertToBytes() [2/2]

static byte [] iTextSharp.text.pdf.PdfEncodings.ConvertToBytes ( string  text,
string  encoding 
)
static

Converts a string to a byte array according to the font's encoding.

Parameters
textthe string to be converted
Returns
an array of byte representing the conversion according to the font's encoding

◆ ConvertToString()

static string iTextSharp.text.pdf.PdfEncodings.ConvertToString ( byte[]  bytes,
string  encoding 
)
static

◆ IsPdfDocEncoding()

static bool iTextSharp.text.pdf.PdfEncodings.IsPdfDocEncoding ( String  text)
static

Checks is text only has PdfDocEncoding characters.

Parameters
textthe String to test
Returns
true if only PdfDocEncoding characters are present

◆ LoadCmap()

static void iTextSharp.text.pdf.PdfEncodings.LoadCmap ( String  name,
byte  newline[][] 
)
static

Loads a CJK cmap to the cache with the option of associating sequences to the newline.

Parameters
namethe CJK cmap name
newlinethe sequences to be replaced bi a newline in the resulting CID. See CRLF_CID_NEWLINE

Member Data Documentation

◆ CIDCHAR

const int iTextSharp.text.pdf.PdfEncodings.CIDCHAR = 2
staticprotected

◆ CIDNONE

const int iTextSharp.text.pdf.PdfEncodings.CIDNONE = 0
staticprotected

◆ CIDRANGE

const int iTextSharp.text.pdf.PdfEncodings.CIDRANGE = 1
staticprotected

◆ CRLF_CID_NEWLINE

byte [][] iTextSharp.text.pdf.PdfEncodings.CRLF_CID_NEWLINE = new byte[][]{new byte[]{(byte)'\n'}, new byte[]{(byte)'\r', (byte)'\n'}}
static

Assumes that '\n' and '\r\n' are the newline sequences. It may not work for all CJK encodings. To be used with LoadCmap().


The documentation for this class was generated from the following file: