com.groupdocs.editor

Class EditorHandler



  • public class EditorHandler
    extends Object

    Main class, which encapsulates conversion methods

    • Constructor Detail

      • EditorHandler

        public EditorHandler()
    • Method Detail

      • detectOptionsFromExtension

        public static IDocumentLoadOptions detectOptionsFromExtension(String filename)

        Returns a default instance of specific document load options class by analyzing the specified filename extension

        Parameters:
        filename - Filename with extension or sole extension
        Returns:
        Instance of a class, which inherits IDocumentLoadOptions, with default parameters, or NULL, if extension cannot be recognized
      • toDocument

        public static void toDocument(OutputHtmlDocument inputHtml,
                      OutputStream outputDocumentContent,
                      IDocumentSaveOptions saveOptions)
                               throws Exception

        Converts specified HTML document to the resultant document of specified type and saves its content to specified stream

        Parameters:
        inputHtml - Input HTML document, which should be converted to some document format
        outputDocumentContent - Output stream, in which the content of the resultant document will be recorded. Should support writing.
        saveOptions - Document saving options, which define the format of the resultant document, and also general and format-specific saving options.
        Throws:
        Exception
      • toHtml

        public static InputHtmlDocument toHtml(InputStream inputDocumentContent)
                                        throws Exception

        Converts a document of supported type to the HTML format, automatically detects the type of the input document and performs a conversion in accordance to the default options for this format

        Parameters:
        inputDocumentContent - Content of the input document. Stream should not be NULL and should support reading.
        Returns:
        Instance of the 'InputHtmlDocument' class, which encapsulates overall HTML document with all its resources.
        Throws:
        Exception
      • toHtml

        public static InputHtmlDocument toHtml(InputStream inputDocumentContent,
                               IDocumentLoadOptions loadOptions)
                                        throws Exception

        Converts document of supported type to the HTML format using specified format-specific options.

        Parameters:
        inputDocumentContent - Content of the input document. Stream should not be NULL and should support reading.
        loadOptions - Format-specific document options, which allows to tune-up conversion process.
        Returns:
        Instance of the 'InputHtmlDocument' class, which encapsulates overall HTML document with all its resources.
        Throws:
        Exception