iText 8.0.5 API
iText.IO.Font.PdfEncodings Class Reference

Static Public Member Functions

static byte[]  ConvertToBytes (String text, String encoding)
  Converts a String to a byte array according to the font's encoding. More...
 
static byte[]  ConvertToBytes (char ch, String encoding)
  Converts a char to a byte array according to the font's encoding. More...
 
static String  ConvertToString (byte[] bytes, String encoding)
  Converts a byte array to a String according to the some encoding. More...
 
static bool  IsPdfDocEncoding (String text)
  Checks is text only has PDF_DOC_ENCODING characters. More...
 
static void  AddExtraEncoding (String name, IExtraEncoding enc)
  Adds an extra encoding. More...
 

Static Public Attributes

const String  IDENTITY_H = "Identity-H"
  The Unicode encoding with horizontal writing. More...
 
const String  IDENTITY_V = "Identity-V"
  The Unicode encoding with vertical writing. More...
 
const String  CP1250 = "Windows-1250"
  A possible encoding. More...
 
const String  CP1252 = "Windows-1252"
  A possible encoding. More...
 
const String  CP1253 = "Windows-1253"
  A possible encoding. More...
 
const String  CP1257 = "Windows-1257"
  A possible encoding. More...
 
const String  WINANSI = "Windows-1252"
  A possible encoding. More...
 
const String  MACROMAN = "MacRoman"
  A possible encoding. More...
 
const String  SYMBOL = "Symbol"
  A possible encoding. More...
 
const String  ZAPFDINGBATS = "ZapfDingbats"
  A possible encoding. More...
 
const String  UNICODE_BIG = "UnicodeBig"
  This is the encoding to be used to output text in Unicode. More...
 
const String  UNICODE_BIG_UNMARKED = "UnicodeBigUnmarked"
  This is the encoding to be used to output text for Identity-H/V CMaps. More...
 
const String  PDF_DOC_ENCODING = "PDF"
  This is the default encoding to be used for converting Strings into bytes and vice versa. More...
 
const String  UTF8 = "UTF-8"
 

Member Function Documentation

◆ AddExtraEncoding()

static void iText.IO.Font.PdfEncodings.AddExtraEncoding ( String  name,
IExtraEncoding  enc 
)
inlinestatic

Adds an extra encoding.

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

◆ ConvertToBytes() [1/2]

static byte [] iText.IO.Font.PdfEncodings.ConvertToBytes ( char  ch,
String  encoding 
)
inlinestatic

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

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

◆ ConvertToBytes() [2/2]

static byte [] iText.IO.Font.PdfEncodings.ConvertToBytes ( String  text,
String  encoding 
)
inlinestatic

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

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

◆ ConvertToString()

static String iText.IO.Font.PdfEncodings.ConvertToString ( byte[]  bytes,
String  encoding 
)
inlinestatic

Converts a byte array to a String according to the some encoding.

Parameters
bytes the bytes to convert
encoding the encoding
Returns
the converted String

◆ IsPdfDocEncoding()

static bool iText.IO.Font.PdfEncodings.IsPdfDocEncoding ( String  text )
inlinestatic

Checks is text only has PDF_DOC_ENCODING characters.

Parameters
text the String to test
Returns

true if only PDF_DOC_ENCODING characters are present

Member Data Documentation

◆ CP1250

const String iText.IO.Font.PdfEncodings.CP1250 = "Windows-1250"
static

A possible encoding.

◆ CP1252

const String iText.IO.Font.PdfEncodings.CP1252 = "Windows-1252"
static

A possible encoding.

◆ CP1253

const String iText.IO.Font.PdfEncodings.CP1253 = "Windows-1253"
static

A possible encoding.

◆ CP1257

const String iText.IO.Font.PdfEncodings.CP1257 = "Windows-1257"
static

A possible encoding.

◆ IDENTITY_H

const String iText.IO.Font.PdfEncodings.IDENTITY_H = "Identity-H"
static

The Unicode encoding with horizontal writing.

◆ IDENTITY_V

const String iText.IO.Font.PdfEncodings.IDENTITY_V = "Identity-V"
static

The Unicode encoding with vertical writing.

◆ MACROMAN

const String iText.IO.Font.PdfEncodings.MACROMAN = "MacRoman"
static

A possible encoding.

◆ PDF_DOC_ENCODING

const String iText.IO.Font.PdfEncodings.PDF_DOC_ENCODING = "PDF"
static

This is the default encoding to be used for converting Strings into bytes and vice versa.

This is the default encoding to be used for converting Strings into bytes and vice versa. The default encoding is PDF_DOC_ENCODING.

◆ SYMBOL

const String iText.IO.Font.PdfEncodings.SYMBOL = "Symbol"
static

A possible encoding.

◆ UNICODE_BIG

const String iText.IO.Font.PdfEncodings.UNICODE_BIG = "UnicodeBig"
static

This is the encoding to be used to output text in Unicode.

◆ UNICODE_BIG_UNMARKED

const String iText.IO.Font.PdfEncodings.UNICODE_BIG_UNMARKED = "UnicodeBigUnmarked"
static

This is the encoding to be used to output text for Identity-H/V CMaps.

◆ WINANSI

const String iText.IO.Font.PdfEncodings.WINANSI = "Windows-1252"
static

A possible encoding.

◆ ZAPFDINGBATS

const String iText.IO.Font.PdfEncodings.ZAPFDINGBATS = "ZapfDingbats"
static

A possible encoding.