com.groupdocs.conversion

Class Converter



  • public class Converter
    extends Object

    Represents main class that controls document conversion process.

    • Constructor Detail

      • Converter

        public Converter(InputStream document)

        Initializes new instance of Converter class.

        Parameters:
        document - The method that returns readable stream.
        Throws:
        com.aspose.ms.System.ArgumentNullException - Thrown when document is null.
      • Converter

        public Converter(InputStream document,
                 ConverterSettings settings)

        Initializes new instance of Converter class.

        Parameters:
        document - The method that returns readable stream.
        settings - The Converter settings.
      • Converter

        public Converter(InputStream document,
                 LoadOptions loadOptions)

        Initializes new instance of Converter class.

        Parameters:
        document - The method that returns readable stream.
        loadOptions - The methods that returns document load options.
      • Converter

        public Converter(InputStream document,
                 LoadOptions loadOptions,
                 ConverterSettings settings)

        Initializes new instance of Converter class.

        Parameters:
        document - The method that returns readable stream.
        loadOptions - The methods that returns document load options.
        settings - The Converter settings.
      • Converter

        public Converter(String filePath)

        Initializes new instance of Converter class.

        Parameters:
        filePath - The file path to the source document.
      • Converter

        public Converter(String filePath,
                 ConverterSettings settings)

        Initializes new instance of Converter class.

        Parameters:
        filePath - The file path to the source document.
        settings - The Converter settings.
      • Converter

        public Converter(String filePath,
                 LoadOptions loadOptions)

        Initializes new instance of Converter class.

        Parameters:
        filePath - The file path to the source document.
        loadOptions - The methods that returns document load options.
      • Converter

        public Converter(String filePath,
                 LoadOptions loadOptions,
                 ConverterSettings settings)

        Initializes new instance of Converter class.

        Parameters:
        filePath - The file path to the source document.
        loadOptions - The methods that returns document load options.
        settings - The Converter settings.
    • Method Detail

      • convert

        public final void convert(OutputStream document,
                   ConvertOptions convertOptions)

        Converts source document. Saves the whole converted document.

        Parameters:
        document - The output stream.
        convertOptions - The convert options specific to desired target file type.
      • convert

        public void convert(OutputStream document,
                   ConvertedDocumentStream documentCompleted,
                   ConvertOptions convertOptions)
        Converts source document. Saves the whole converted document.
        Parameters:
        document - output stream
        documentCompleted - the delegate that receive converted document stream.
        convertOptions - the convert options specific to desired target file type.
      • convert

        public final void convert(String filePath,
                   ConvertOptions convertOptions)

        Converts source document. Saves the whole converted document.

        Parameters:
        filePath - The file path to the source document.
        convertOptions - The convert options specific to desired target file type.
      • convertPageByPage

        public final void convertPageByPage(OutputStream document,
                             ConvertOptions convertOptions)

        Converts source document. Saves the converted document page by page.

        Parameters:
        document - The output stream.
        convertOptions - The convert options specific to desired target file type.
      • convert

        public void convert(OutputStream document,
                   ConvertedPageStream documentCompleted,
                   ConvertOptions convertOptions)
        Converts source document. Saves the converted document page by page.
        Parameters:
        document - The delegate that saves converted document page to a stream.
        documentCompleted - The delegate that receive converted document page stream.
        convertOptions - The convert options specific to desired target file type.
      • getDocumentInfo

        public final IDocumentInfo getDocumentInfo()

        Gets source document info - pages count and other document properties specific to the file type.

        Returns:
        document info
      • getPossibleConversions

        public final PossibleConversions getPossibleConversions()

        Gets possible conversions for the source document.

        Returns:
        possible conversions
      • getAllPossibleConversions

        public static List<PossibleConversions> getAllPossibleConversions()
        Gets all supported conversions
        Returns:
        supported conversions
      • getPossibleConversions

        public static PossibleConversions getPossibleConversions(String extension)
        Gets supported conversions for provided document extension Converter.GetPossibleConversions(".docx") Converter.GetPossibleConversions("docx")
        Parameters:
        extension - Document extension
        Returns:
        possible conversions
      • dispose

        public final void dispose()

        Releases resources.

      • getContext

        protected com.groupdocs.conversion.pipeline.ConversionContext getContext()