Table of Contents

Class HtmlEncoder

Namespace
iTextSharp.text.html
Assembly
iTextSharp.LGPLv2.Core.dll

This class converts a String to the HTML-format of a String. To convert the String , each character is examined: ASCII-characters from 000 till 031 are represented as &#xxx; (with xxx = the value of the character) ASCII-characters from 032 t/m 127 are represented by the character itself, except for: '\n' becomes <BR>\n " becomes &quot; & becomes &amp; < becomes &lt;

becomes &gt; ASCII-characters from 128 till 255 are represented as &#xxx; (with xxx = the value of the character) Example: String htmlPresentation = HtmlEncoder.Encode("Marie-Thérèse Sørensen"); for more info: see O'Reilly; "HTML: The Definitive Guide" (page 164) @author mario.maccarini@rug.ac.be

public static class HtmlEncoder
Inheritance
HtmlEncoder
Inherited Members

Methods

Encode(string)

methods

public static string Encode(string str)

Parameters

str string

The String to convert

Returns

string

a String

Encode(BaseColor)

Converts a Color into a HTML representation of this Color .

public static string Encode(BaseColor color)

Parameters

color BaseColor

the Color that has to be converted.

Returns

string

the HTML representation of this Color

GetAlignment(int)

Translates the alignment value.

public static string GetAlignment(int alignment)

Parameters

alignment int

the alignment value

Returns

string

the translated value