public final class OutputHtmlDocument extends Object implements IAuxDisposable
Encapsulates one HTML document, which is obtained from HTML->Document conversion and contains HTML markup and all related resources like CSS, images and fonts.
Modifier and Type | Class and Description |
---|---|
static class |
OutputHtmlDocument.LinkToResourceMapperDelegate
Delegate, which allows to obtain a local resource for specified link, extracted from HTML markup
|
Modifier and Type | Field and Description |
---|---|
com.groupdocs.editor.events.ProcessEvents<com.groupdocs.editor.events.ProcessEventHandler> |
Disposed
Event, which occurs when this HTML document is disposed, right after finishing the disposing process
|
Constructor and Description |
---|
OutputHtmlDocument(String htmlMarkup)
Creates a new instance of the OutputHtmlDocument with specified HTML markup
|
OutputHtmlDocument(String htmlMarkup,
List<IHtmlResource> resources)
Creates a new instance of the OutputHtmlDocument with specified HTML markup and list of resources
|
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Disposes this HTML document instance, disposing its resources
|
static OutputHtmlDocument |
fromFile(String htmlFilePath)
Helper factory method, which creates and returns an instance of the OutputHtmlDocument,
which is created from specified file with HTML markup.
|
static OutputHtmlDocument |
fromFile(String htmlFilePath,
String resourcesFolderPath)
Helper factory method, which creates and returns an instance of the OutputHtmlDocument, which is created from specified file with HTML markup
and from specified accompanying folder with related resources.
|
static OutputHtmlDocument |
fromMarkup(String htmlDocumentMarkup,
String resourcesFolderPath)
Helper factory method, which creates and returns an instance of the OutputHtmlDocument,
which is created from specified HTML markup and a set of resources, which are located in the specified folder.
|
String |
getHtmlMarkup()
Returns HTML markup of this HTML document instance
|
OutputHtmlDocument.LinkToResourceMapperDelegate |
getLinkToResourceMapper()
Allows to obtain or specify a delegate, which is responsible for mapping links to local resources with these resources
|
List<IHtmlResource> |
getResources()
Allows to obtain or specify external resources, which are used by this HTML document: CSS, images and fonts.
|
com.aspose.ms.System.Collections.Generic.List<IHtmlResource> |
getResourcesInternal() |
boolean |
isDisposed()
Determines whether this HTML document is already disposed or not
|
void |
setLinkToResourceMapper(OutputHtmlDocument.LinkToResourceMapperDelegate value)
Allows to obtain or specify a delegate, which is responsible for mapping links to local resources with these resources
|
public final com.groupdocs.editor.events.ProcessEvents<com.groupdocs.editor.events.ProcessEventHandler> Disposed
Event, which occurs when this HTML document is disposed, right after finishing the disposing process
public OutputHtmlDocument(String htmlMarkup)
Creates a new instance of the OutputHtmlDocument with specified HTML markup
htmlMarkup
- HTML markup in a form of string. Should not be NULL or empty. Should be a valid HTML.public OutputHtmlDocument(String htmlMarkup, List<IHtmlResource> resources)
Creates a new instance of the OutputHtmlDocument with specified HTML markup and list of resources
htmlMarkup
- HTML markup in a form of the stringresources
- List of external resources, which are used by specified HTML document. If there are no resources, can be NULL or empty.public void dispose()
Disposes this HTML document instance, disposing its resources
dispose
in interface com.aspose.ms.System.IDisposable
public static OutputHtmlDocument fromFile(String htmlFilePath) throws Exception
Helper factory method, which creates and returns an instance of the OutputHtmlDocument, which is created from specified file with HTML markup. Automatically tries to find and process the accompanying folder with related resources.
htmlFilePath
- Full path to the file with HTML markup.Exception
public static OutputHtmlDocument fromFile(String htmlFilePath, String resourcesFolderPath) throws Exception
Helper factory method, which creates and returns an instance of the OutputHtmlDocument, which is created from specified file with HTML markup and from specified accompanying folder with related resources.
htmlFilePath
- Full path to the file with HTML markup.resourcesFolderPath
- Full path to the accompanying folder with related resources.Exception
public static OutputHtmlDocument fromMarkup(String htmlDocumentMarkup, String resourcesFolderPath) throws Exception
Helper factory method, which creates and returns an instance of the OutputHtmlDocument, which is created from specified HTML markup and a set of resources, which are located in the specified folder.
htmlDocumentMarkup
- HTML markup in a form of the stringresourcesFolderPath
- Full path to the folder, where related resources are located.Exception
public String getHtmlMarkup()
Returns HTML markup of this HTML document instance
public OutputHtmlDocument.LinkToResourceMapperDelegate getLinkToResourceMapper()
Allows to obtain or specify a delegate, which is responsible for mapping links to local resources with these resources
public List<IHtmlResource> getResources()
Allows to obtain or specify external resources, which are used by this HTML document: CSS, images and fonts.
public com.aspose.ms.System.Collections.Generic.List<IHtmlResource> getResourcesInternal()
public boolean isDisposed()
Determines whether this HTML document is already disposed or not
isDisposed
in interface IAuxDisposable
public void setLinkToResourceMapper(OutputHtmlDocument.LinkToResourceMapperDelegate value)
Allows to obtain or specify a delegate, which is responsible for mapping links to local resources with these resources
Copyright © 2018. All rights reserved.