com.groupdocs.editor

Class OutputHtmlDocument

  • All Implemented Interfaces:
    com.aspose.ms.System.IDisposable, IAuxDisposable


    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.


    The instances of this class should be created by users and passed into the EditorHandler.ToDocument method in order to perform backward conversion (from HTML to document of any supported type).

    • Field Summary

      Fields 
      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 Summary

      Constructors 
      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
    • Field Detail

      • Disposed

        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

    • Constructor Detail

      • OutputHtmlDocument

        public OutputHtmlDocument(String htmlMarkup)

        Creates a new instance of the OutputHtmlDocument with specified HTML markup

        Parameters:
        htmlMarkup - HTML markup in a form of string. Should not be NULL or empty. Should be a valid HTML.
      • OutputHtmlDocument

        public OutputHtmlDocument(String htmlMarkup,
                          List<IHtmlResource> resources)

        Creates a new instance of the OutputHtmlDocument with specified HTML markup and list of resources

        Parameters:
        htmlMarkup - HTML markup in a form of the string
        resources - List of external resources, which are used by specified HTML document. If there are no resources, can be NULL or empty.
    • Method Detail

      • dispose

        public void dispose()

        Disposes this HTML document instance, disposing its resources

        Specified by:
        dispose in interface com.aspose.ms.System.IDisposable
      • fromFile

        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.

        Parameters:
        htmlFilePath - Full path to the file with HTML markup.
        Returns:
        Throws:
        Exception
      • fromFile

        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.

        Parameters:
        htmlFilePath - Full path to the file with HTML markup.
        resourcesFolderPath - Full path to the accompanying folder with related resources.
        Returns:
        Throws:
        Exception
      • fromMarkup

        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.

        Parameters:
        htmlDocumentMarkup - HTML markup in a form of the string
        resourcesFolderPath - Full path to the folder, where related resources are located.
        Returns:
        Throws:
        Exception
      • getHtmlMarkup

        public String getHtmlMarkup()

        Returns HTML markup of this HTML document instance

      • getResources

        public List<IHtmlResource> getResources()

        Allows to obtain or specify external resources, which are used by this HTML document: CSS, images and fonts.

      • getResourcesInternal

        public com.aspose.ms.System.Collections.Generic.List<IHtmlResource> getResourcesInternal()
      • isDisposed

        public boolean isDisposed()

        Determines whether this HTML document is already disposed or not

        Specified by:
        isDisposed in interface IAuxDisposable
      • setLinkToResourceMapper

        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