HtmlFragment

Inheritance: java.lang.Object, com.aspose.pdf.BaseParagraph, com.aspose.pdf.FormattedFragment

public final class HtmlFragment extends FormattedFragment

Represents html fragment.

Constructors

ConstructorDescription
HtmlFragment(String text)Initializes a new instance of the HtmlFragment class.

Methods

MethodDescription
getRectangle()Gets rectangle of the HtmlFragment
isParagraphHasMargin()Gets or sets is paragraph has default margin otherwise margin is 0
setParagraphHasMargin(boolean value)Gets or sets is paragraph has default margin otherwise margin is 0
isBreakWords()Gets or sets words break
setBreakWords(boolean value)Gets or sets words break
getTextState()Gets or sets font
setTextState(TextState value)Gets or sets font
getHtmlLoadOptions()Gets HtmlLoadOptions that will be used for loading (and rendering) of HTML into this instance of class.
setHtmlLoadOptions(HtmlLoadOptions value)Sets HtmlLoadOptions that will be used for loading (and rendering) of HTML into this instance of class.
deepClone()Clones html fragment.

HtmlFragment(String text)

public HtmlFragment(String text)

Initializes a new instance of the HtmlFragment class.

Parameters:

ParameterTypeDescription
textjava.lang.StringThe fragment text

getRectangle()

public final Rectangle2D.Float getRectangle()

Gets rectangle of the HtmlFragment

Returns: java.awt.geom.Rectangle2D.Float - java.awt.geom.Rectangle2D.Float instance

isParagraphHasMargin()

public final boolean isParagraphHasMargin()

Gets or sets is paragraph has default margin otherwise margin is 0

Returns: boolean - boolean value

setParagraphHasMargin(boolean value)

public final void setParagraphHasMargin(boolean value)

Gets or sets is paragraph has default margin otherwise margin is 0

Parameters:

ParameterTypeDescription
valuebooleanboolean value

isBreakWords()

public final boolean isBreakWords()

Gets or sets words break

Returns: boolean - boolean value

setBreakWords(boolean value)

public final void setBreakWords(boolean value)

Gets or sets words break

Parameters:

ParameterTypeDescription
valuebooleanboolean value

getTextState()

public TextState getTextState()

Gets or sets font

Returns: TextState - TextState object

setTextState(TextState value)

public void setTextState(TextState value)

Gets or sets font

Parameters:

ParameterTypeDescription
valueTextStateTextState object

getHtmlLoadOptions()

public HtmlLoadOptions getHtmlLoadOptions()

Gets HtmlLoadOptions that will be used for loading (and rendering) of HTML into this instance of class. Please use it when it’s necessary use specific setting for import of HTML for this or that instance (f.e when this or that instance should use specific BasePath for imported HTML or should use specific loader of external resources) If parameter is default (null), then standard HTML loading options will be used.

Returns: HtmlLoadOptions - HtmlLoadOptions value

setHtmlLoadOptions(HtmlLoadOptions value)

public void setHtmlLoadOptions(HtmlLoadOptions value)

Sets HtmlLoadOptions that will be used for loading (and rendering) of HTML into this instance of class. Please use it when it’s necessary use specific setting for import of HTML for this or that instance (f.e when this or that instance should use specific BasePath for imported HTML or should use specific loader of external resources) If parameter is default (null), then standard HTML loading options will be used.

Parameters:

ParameterTypeDescription
valueHtmlLoadOptionsHtmlLoadOptions value

deepClone()

public Object deepClone()

Clones html fragment.

Returns: java.lang.Object - Cloned html fragment object.