Interface DocumentFormatConversion

    • Method Detail

      • convert

        File convert​(File source,
                     DocumentFormat inFormat,
                     FilterOption... options)
        Converts the specified document in the specified format. The format should be supported by the converter. If an error occurs while converting the specified file, then a runtime exception DocumentFormatConversionException is thrown.
        Parameters:
        source - the document to convert.
        inFormat - the format into which the document has to be converted.
        options - additional options such as "PageRange"
        Returns:
        the file with the converted document.
      • convert

        File convert​(File source,
                     File destination,
                     DocumentFormat outFormat,
                     FilterOption... options)
        Converts the specified document in the specified format. The format should be supported by the converter. If an error occurs while converting the specified file, then a runtime exception DocumentFormatConversionException is thrown.
        Parameters:
        source - the document to convert.
        destination - the converted document.
        outFormat - the format into which the document has to be converted.
        Returns:
        the destination file.
      • convert

        void convert​(InputStream source,
                     DocumentFormat inFormat,
                     OutputStream destination,
                     DocumentFormat outFormat,
                     FilterOption... options)
        Converts the specified inputstream/format in the specified outputstream/format.
        Parameters:
        source - the source stream to convert.
        inFormat - the format from which the document has to be converted.
        destination - the converted stream.
        outFormat - the format into which the document has to be converted.
      • getSupportedFormats

        DocumentFormat[] getSupportedFormats()
        Gets the formats of documents supported by the converter.
        Returns:
        an array with the different formats into which the object implementing this interface can convert a document.