|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.itextpdf.text.html.HtmlUtilities
public class HtmlUtilities
A class that contains some utilities to parse HTML attributes and content.
| Field Summary | |
|---|---|
static float |
DEFAULT_FONT_SIZE
a default value for font-size |
static int[] |
FONTSIZES
A series of predefined font sizes. |
| Constructor Summary | |
|---|---|
HtmlUtilities()
|
|
| Method Summary | |
|---|---|
static int |
alignmentValue(java.lang.String alignment)
Translates a String value to an alignment value. |
static BaseColor |
decodeColor(java.lang.String s)
Converts a BaseColor into a HTML representation of this
BaseColor. |
static java.lang.String |
eliminateWhiteSpace(java.lang.String content)
Helper class that reduces the white space in a String |
static int |
getIndexedFontSize(java.lang.String value,
java.lang.String previous)
Picks a font size from a series of predefined font sizes. |
static java.util.Properties |
parseAttributes(java.lang.String string)
This method parses a String with attributes and returns a Properties object. |
static float |
parseLength(java.lang.String string)
Parses a length. |
static float |
parseLength(java.lang.String string,
float actualFontSize)
New method contributed by: Lubos Strapko |
static java.lang.String |
removeComment(java.lang.String string,
java.lang.String startComment,
java.lang.String endComment)
Removes the comments sections of a String. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final float DEFAULT_FONT_SIZE
public static final int[] FONTSIZES
| Constructor Detail |
|---|
public HtmlUtilities()
| Method Detail |
|---|
public static float parseLength(java.lang.String string)
string - a length in the form of an optional + or -, followed by a
number and a unit.
public static float parseLength(java.lang.String string,
float actualFontSize)
public static BaseColor decodeColor(java.lang.String s)
BaseColor into a HTML representation of this
BaseColor.
s - the BaseColor that has to be converted.
public static java.util.Properties parseAttributes(java.lang.String string)
string - a String of this form: 'key1="value1"; key2="value2";...
keyN="valueN" '
public static java.lang.String removeComment(java.lang.String string,
java.lang.String startComment,
java.lang.String endComment)
string - the original StringstartComment - the String that marks the start of a Comment sectionendComment - the String that marks the end of a Comment section.
public static java.lang.String eliminateWhiteSpace(java.lang.String content)
content - content containing whitespace
public static int getIndexedFontSize(java.lang.String value,
java.lang.String previous)
value - the new value of a font, expressed as an indexprevious - the previous value of the font size
public static int alignmentValue(java.lang.String alignment)
alignment - a String (one of the ALIGN_ constants of this class)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||