Package com.itextpdf.text.html
Class HtmlEncoder
java.lang.Object
com.itextpdf.text.html.HtmlEncoder
Deprecated.
since 5.5.2
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 "
- & becomes &
- < becomes <
- > becomes >
- 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)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String[]
Deprecated.List with the HTML translation of all the characters.Deprecated.Set containing tags that trigger a new line. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
Deprecated.This class will never be constructed. -
Method Summary
Modifier and TypeMethodDescriptionstatic String
Deprecated.Converts aBaseColor
into a HTML representation of thisBaseColor
.static String
Deprecated.Converts aString
to the HTML-format of thisString
.static String
getAlignment
(int alignment) Deprecated.Translates the alignment value.static boolean
isNewLineTag
(String tag) Deprecated.Returns true if the tag causes a new line like p, br etc.
-
Field Details
-
HTML_CODE
Deprecated.List with the HTML translation of all the characters.- Since:
- 5.0.6 (renamed from htmlCode)
-
NEWLINETAGS
Deprecated.Set containing tags that trigger a new line.- Since:
- iText 5.0.6
-
-
Constructor Details
-
HtmlEncoder
private HtmlEncoder()Deprecated.This class will never be constructed.
-
-
Method Details
-
encode
Deprecated.Converts aString
to the HTML-format of thisString
.- Parameters:
string
- TheString
to convert- Returns:
- a
String
-
encode
Deprecated.Converts aBaseColor
into a HTML representation of thisBaseColor
.- Parameters:
color
- theBaseColor
that has to be converted.- Returns:
- the HTML representation of this
BaseColor
-
getAlignment
Deprecated.Translates the alignment value.- Parameters:
alignment
- the alignment value- Returns:
- the translated value
-
isNewLineTag
Deprecated.Returns true if the tag causes a new line like p, br etc.- Since:
- iText 5.0.6
-