HtmlLoadOptions

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

public final class HtmlLoadOptions extends LoadOptions

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

Constructors

ConstructorDescription
HtmlLoadOptions()Creates load options for converting html into pdf document with empty base path.
HtmlLoadOptions(String basePath)Creates load options for converting html into pdf document with defined base path.

Methods

MethodDescription
isRenderToSinglePage()Gets or sets rendering all document to single page
setRenderToSinglePage(boolean value)Gets or sets rendering all document to single page
isEmbedFonts()Gets or sets fonts embedding to result document
setEmbedFonts(boolean value)Gets or sets fonts embedding to result document
getPageLayoutOption()Gets or sets layout option.
setPageLayoutOption(int value)Gets or sets layout option.
getHtmlMediaType()Gets or sets possible media types used during rendering.
setHtmlMediaType(int value)Gets or sets possible media types used during rendering.
getInputEncoding()Gets the attribute specifying the encoding used for this document at the time of the parsing.
setInputEncoding(String value)Sets the attribute specifying the encoding used for this document at the time of the parsing.
getBasePath()The base path/url for the html file.
getPageInfo()Gets document page info
setPageInfo(PageInfo value)Sets document page info
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.
setCustomLoaderOfExternalResources(LoadOptions.ResourceLoadingStrategy customLoaderOfExternalResources)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.

HtmlLoadOptions()

public HtmlLoadOptions()

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

HtmlLoadOptions(String basePath)

public HtmlLoadOptions(String basePath)

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

Parameters:

ParameterTypeDescription
basePathjava.lang.StringThe base path/url for the html file.

isRenderToSinglePage()

public final boolean isRenderToSinglePage()

Gets or sets rendering all document to single page

Returns: boolean - boolean value

setRenderToSinglePage(boolean value)

public final void setRenderToSinglePage(boolean value)

Gets or sets rendering all document to single page

Parameters:

ParameterTypeDescription
valuebooleanboolean value

isEmbedFonts()

public final boolean isEmbedFonts()

Gets or sets fonts embedding to result document

Returns: boolean - boolean value

setEmbedFonts(boolean value)

public final void setEmbedFonts(boolean value)

Gets or sets fonts embedding to result document

Parameters:

ParameterTypeDescription
valuebooleanboolean value

getPageLayoutOption()

public final int getPageLayoutOption()

Gets or sets layout option.

Returns: int - HtmlPageLayoutOption element

setPageLayoutOption(int value)

public final void setPageLayoutOption(int value)

Gets or sets layout option.

Parameters:

ParameterTypeDescription
valueintHtmlPageLayoutOption element

getHtmlMediaType()

public int getHtmlMediaType()

Gets or sets possible media types used during rendering.

Returns: int - HtmlMediaType element

setHtmlMediaType(int value)

public void setHtmlMediaType(int value)

Gets or sets possible media types used during rendering.

Parameters:

ParameterTypeDescription
valueintHtmlMediaType 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: java.lang.String - String value

setInputEncoding(String value)

public void setInputEncoding(String value)

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.

Parameters:

ParameterTypeDescription
valuejava.lang.StringString value

getBasePath()

public String getBasePath()

The base path/url for the html file.

Returns: java.lang.String - String value

getPageInfo()

public PageInfo getPageInfo()

Gets document page info

Returns: PageInfo - page info

setPageInfo(PageInfo value)

public void setPageInfo(PageInfo value)

Sets document page info

Parameters:

ParameterTypeDescription
valuePageInfopage info

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 - ResourceLoadingStrategy instance

setCustomLoaderOfExternalResources(LoadOptions.ResourceLoadingStrategy customLoaderOfExternalResources)

public void setCustomLoaderOfExternalResources(LoadOptions.ResourceLoadingStrategy customLoaderOfExternalResources)

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.

Parameters:

ParameterTypeDescription
customLoaderOfExternalResourcesResourceLoadingStrategyResourceLoadingStrategy instance