HtmlLoadOptions

Inheritance: java.lang.Object, com.aspose.pdf.LoadOptions com.aspose.pdf.HtmlLoadOptions, com.aspose.pdf.LoadOptions, com.aspose.pdf.HtmlLoadOptions

public final class HtmlLoadOptions extends LoadOptions

Represents options for loading/importing html file into pdf document.

Constructors

ConstructorDescription
HtmlLoadOptionsCreates load options for converting html into pdf document with empty base path.
HtmlLoadOptionsCreates load options for converting html into pdf document with empty base path.

Methods

MethodDescription
getBasePathThe base path/url for the html file.
getCustomLoaderOfExternalResourcesSometimes it’s necessary to avoid usage of internal loader of external resources(like images or CSSes) and supply custom method that will get requested resources from somewhere. For example, during usage of Aspose.PDF in cloud direct access to referenced files impossible: in such case some customer code put into special method should be used, and delegate that refers that method should be assigned to this attribute.
getHtmlMediaTypeGets or sets possible media types used during rendering.
getInputEncodingGets the attribute specifying the encoding used for this document at the time of the parsing. If this attribute is null the encoding will determine from document character set atribute.
getPageInfoGets document page info
getPageLayoutOptionGets or sets layout option.
isEmbedFontsGets or sets fonts embedding to result document
isPriorityCssPageRuleGets or sets the flag that specifies that @page rules defined in css will override values defined in PageInfo.
isRenderToSinglePageGets or sets rendering all document to single page
setCustomLoaderOfExternalResourcesSometimes it’s necessary to avoid usage of internal loader of external resources(like images or CSSes) and supply custom method that will get requested resources from somewhere.
setEmbedFontsGets or sets fonts embedding to result document
setHtmlMediaTypeGets or sets possible media types used during rendering.
setInputEncodingSets the attribute specifying the encoding used for this document at the time of the parsing. If this attribute is null the encoding will determine from document character set atribute.
setPageInfoSets document page info
setPageLayoutOptionGets or sets layout option.
setPriorityCssPageRuleGets or sets the flag that specifies that @page rules defined in css will override values defined in PageInfo.
setRenderToSinglePageGets or sets rendering all document to single page

HtmlLoadOptions

public HtmlLoadOptions()

Creates load options for converting html into pdf document with empty base path.

HtmlLoadOptions

Creates load options for converting html into pdf document with empty base path.

getBasePath

public String getBasePath()

The base path/url for the html file.

Returns: String value

getCustomLoaderOfExternalResources

public LoadOptions.ResourceLoadingStrategy getCustomLoaderOfExternalResources()

Sometimes it’s necessary to avoid usage of internal loader of external resources(like images or CSSes) and supply custom method that will get requested resources from somewhere. For example, during usage of Aspose.PDF in cloud direct access to referenced files impossible: in such case some customer code put into special method should be used, and delegate that refers that method should be assigned to this attribute.

Returns: ResourceLoadingStrategy instance

getHtmlMediaType

public HtmlMediaType getHtmlMediaType()

Gets or sets possible media types used during rendering.

Returns: HtmlMediaType element

getInputEncoding

public String getInputEncoding()

Gets the attribute specifying the encoding used for this document at the time of the parsing. If this attribute is null the encoding will determine from document character set atribute.

Returns: String value

getPageInfo

public PageInfo getPageInfo()

Gets document page info

Returns: page info

getPageLayoutOption

public final int getPageLayoutOption()

Gets or sets layout option.

Returns: HtmlPageLayoutOption element @see HtmlPageLayoutOption

isEmbedFonts

public final boolean isEmbedFonts()

Gets or sets fonts embedding to result document

Returns: boolean value

isPriorityCssPageRule

public final boolean isPriorityCssPageRule()

Gets or sets the flag that specifies that @page rules defined in css will override values defined in PageInfo.

Returns: boolean value

isRenderToSinglePage

public final boolean isRenderToSinglePage()

Gets or sets rendering all document to single page

Returns: boolean value

setCustomLoaderOfExternalResources

Sometimes it’s necessary to avoid usage of internal loader of external resources(like images or CSSes) and supply custom method that will get requested resources from somewhere.

setEmbedFonts

public final void setEmbedFonts(boolean value)

Gets or sets fonts embedding to result document

Parameters:

ParameterTypeDescription
valueboolean value

setHtmlMediaType

Gets or sets possible media types used during rendering.

setInputEncoding

Sets the attribute specifying the encoding used for this document at the time of the parsing. If this attribute is null the encoding will determine from document character set atribute.

setPageInfo

Sets document page info

setPageLayoutOption

public final void setPageLayoutOption(int value)

Gets or sets layout option.

Parameters:

ParameterTypeDescription
valueHtmlPageLayoutOption element @see HtmlPageLayoutOption

setPriorityCssPageRule

public final void setPriorityCssPageRule(boolean value)

Gets or sets the flag that specifies that @page rules defined in css will override values defined in PageInfo.

Parameters:

ParameterTypeDescription
valueboolean value

setRenderToSinglePage

public final void setRenderToSinglePage(boolean value)

Gets or sets rendering all document to single page

Parameters:

ParameterTypeDescription
valueboolean value