public class Converter extends Object implements Closeable
Represents main class that controls document conversion process.
Constructor and Description |
---|
Converter()
Initializes new instance of
|
Converter(InputStream document)
Deprecated.
This constructor will be removed in next release
|
Converter(InputStream document,
ConverterSettings settings)
Deprecated.
This constructor will be removed in next release
|
Converter(InputStream document,
com.groupdocs.conversion.contracts.Func1<FileType,LoadOptions> loadOptions)
Deprecated.
This constructor will be removed in next release
|
Converter(InputStream document,
com.groupdocs.conversion.contracts.Func1<FileType,LoadOptions> loadOptions,
ConverterSettings settings)
Deprecated.
This constructor will be removed in next release
|
Converter(InputStream document,
LoadOptions loadOptions)
Deprecated.
This constructor will be removed in next release
|
Converter(InputStream document,
LoadOptions loadOptions,
ConverterSettings settings)
Deprecated.
This constructor will be removed in next release
|
Converter(String filePath)
Initializes new instance of
Converter class. |
Converter(String filePath,
ConverterSettings settings)
Deprecated.
|
Converter(String filePath,
ConverterSettingsProvider settings)
Initializes new instance of
Converter class. |
Converter(String filePath,
LoadOptions loadOptions)
Deprecated.
|
Converter(String filePath,
LoadOptions loadOptions,
ConverterSettings settings)
Deprecated.
|
Converter(String filePath,
com.groupdocs.conversion.contracts.LoadOptionsForFileTypeProvider loadOptions)
|
Converter(String filePath,
com.groupdocs.conversion.contracts.LoadOptionsForFileTypeProvider loadOptions,
ConverterSettingsProvider settings)
|
Converter(String filePath,
com.groupdocs.conversion.contracts.LoadOptionsProvider loadOptions)
Initializes new instance of
Converter class. |
Converter(String filePath,
com.groupdocs.conversion.contracts.LoadOptionsProvider loadOptions,
ConverterSettingsProvider settings)
Initializes new instance of
Converter class. |
Converter(Supplier<InputStream> document)
Initializes new instance of
Converter class. |
Converter(Supplier<InputStream> document,
ConverterSettingsProvider settings)
Initializes new instance of
Converter class. |
Converter(Supplier<InputStream> document,
com.groupdocs.conversion.contracts.LoadOptionsForFileTypeProvider loadOptions)
Initializes new instance of
|
Converter(Supplier<InputStream> document,
com.groupdocs.conversion.contracts.LoadOptionsForFileTypeProvider loadOptions,
ConverterSettingsProvider settings)
Initializes new instance of
|
Converter(Supplier<InputStream> document,
com.groupdocs.conversion.contracts.LoadOptionsProvider loadOptions)
Initializes new instance of
Converter class. |
Converter(Supplier<InputStream> document,
com.groupdocs.conversion.contracts.LoadOptionsProvider loadOptions,
ConverterSettingsProvider settings)
Initializes new instance of
Converter class. |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
convert(OutputStream document,
ConvertedDocumentStream documentCompleted,
ConvertOptions convertOptions)
Deprecated.
This method will be removed in next release
|
void |
convert(OutputStream document,
ConvertedPageStream documentCompleted,
ConvertOptions convertOptions)
Deprecated.
This method will be removed in next release
|
void |
convert(OutputStream document,
ConvertOptions convertOptions)
Deprecated.
This method will be removed in next release
|
void |
convert(OutputStream document,
ConvertOptionsProvider convertOptionsProvider)
Deprecated.
This method will be removed in next release
|
void |
convert(SaveDocumentStream document,
ConvertedDocumentStream documentCompleted,
ConvertOptions convertOptions)
Converts source document.
|
void |
convert(SaveDocumentStream document,
ConvertedDocumentStream documentCompleted,
ConvertOptionsProvider convertOptionsProvider)
|
void |
convert(SaveDocumentStream document,
ConvertOptions convertOptions)
Converts source document.
|
void |
convert(SaveDocumentStream document,
ConvertOptionsProvider convertOptionsProvider)
|
void |
convert(SaveDocumentStreamForFileType document,
ConvertedDocumentStream documentCompleted,
ConvertOptions convertOptions)
|
void |
convert(SaveDocumentStreamForFileType document,
ConvertedDocumentStream documentCompleted,
ConvertOptionsProvider convertOptionsProvider)
|
void |
convert(SaveDocumentStreamForFileType document,
ConvertOptions convertOptions)
|
void |
convert(SaveDocumentStreamForFileType document,
ConvertOptionsProvider convertOptionsProvider)
|
void |
convert(SavePageStream document,
ConvertedPageStream documentCompleted,
ConvertOptions convertOptions)
Converts source document.
|
void |
convert(SavePageStream document,
ConvertedPageStream documentCompleted,
ConvertOptionsProvider convertOptionsProvider)
|
void |
convert(SavePageStream document,
ConvertOptions convertOptions)
Converts source document.
|
void |
convert(SavePageStream document,
ConvertOptionsProvider convertOptionsProvider)
|
void |
convert(SavePageStreamForFileType document,
ConvertedPageStream documentCompleted,
ConvertOptions convertOptions)
|
void |
convert(SavePageStreamForFileType document,
ConvertedPageStream documentCompleted,
ConvertOptionsProvider convertOptionsProvider)
|
void |
convert(SavePageStreamForFileType document,
ConvertOptions convertOptions)
|
void |
convert(SavePageStreamForFileType document,
ConvertOptionsProvider convertOptionsProvider)
|
void |
convert(String filePath,
ConvertOptions convertOptions)
Converts source document.
|
void |
convertPageByPage(OutputStream document,
ConvertOptions convertOptions)
Deprecated.
This method will be removed in next release
|
void |
dispose()
Releases resources.
|
static List<PossibleConversions> |
getAllPossibleConversions()
Gets all supported conversions
|
IDocumentInfo |
getDocumentInfo()
Gets source document info - pages count and other document properties specific to the file type.
|
PossibleConversions |
getPossibleConversions()
Gets possible conversions for the source document.
|
static PossibleConversions |
getPossibleConversions(String extension)
Gets supported conversions for provided document extension
|
com.groupdocs.conversion.fluent.IConversionLoadOptionsOrSourceDocumentLoaded |
load(DocumentStreamProvider documentStreamProvider) |
com.groupdocs.conversion.fluent.IConversionLoadOptionsOrSourceDocumentLoaded |
load(DocumentStreamsProvider documentStreamProvider) |
com.groupdocs.conversion.fluent.IConversionLoadOptionsOrSourceDocumentLoaded |
load(String fileName) |
com.groupdocs.conversion.fluent.IConversionLoadOptionsOrSourceDocumentLoaded |
load(String[] fileNames) |
static void |
tweakPackageUtil(String vendor,
String version,
String specTitle) |
com.groupdocs.conversion.fluent.IConversionFrom |
withSettings(ConverterSettingsProvider settingsProvider) |
@Deprecated public Converter(InputStream document)
@Deprecated public Converter(InputStream document, ConverterSettings settings)
@Deprecated public Converter(InputStream document, LoadOptions loadOptions)
@Deprecated public Converter(InputStream document, LoadOptions loadOptions, ConverterSettings settings)
@Deprecated public Converter(InputStream document, com.groupdocs.conversion.contracts.Func1<FileType,LoadOptions> loadOptions)
@Deprecated public Converter(InputStream document, com.groupdocs.conversion.contracts.Func1<FileType,LoadOptions> loadOptions, ConverterSettings settings)
public Converter()
var converter = new Converter();
converter
.Load("")
.ConvertTo("")
.Convert();
converter
.WithSettings(() => new ConverterSettings())
.Load("").WithOptions(new PdfLoadOptions())
.ConvertTo("").WithOptions(new PdfConvertOptions())
.OnConversionCompleted(convertedDocumentStream => { })
.Convert();
converter
.Load("").WithOptions(new PdfLoadOptions())
.ConvertByPageTo((number => new FileStream("", FileMode.Create))).WithOptions(new PdfConvertOptions())
.OnConversionCompleted((number, stream) => {})
.Convert();
converter.Load("").GetPossibleConversions();
converter.Load("").GetDocumentInfo();
converter.Load("").WithOptions(new PdfLoadOptions()).GetPossibleConversions();
converter.Load("").WithOptions(new PdfLoadOptions()).GetDocumentInfo();
public Converter(Supplier<InputStream> document)
Initializes new instance of Converter
class.
document
- input stream supplier.com.aspose.ms.System.ArgumentNullException
- Thrown when document
is null.public Converter(Supplier<InputStream> document, ConverterSettingsProvider settings)
Initializes new instance of Converter
class.
document
- An input stream supplier.settings
- A Converter settings supplier.public Converter(Supplier<InputStream> document, com.groupdocs.conversion.contracts.LoadOptionsProvider loadOptions)
Initializes new instance of Converter
class.
document
- An input stream supplier.loadOptions
- A load options supplier.public Converter(Supplier<InputStream> document, com.groupdocs.conversion.contracts.LoadOptionsProvider loadOptions, ConverterSettingsProvider settings)
Initializes new instance of Converter
class.
document
- An input stream supplier.loadOptions
- A document load options supplier.settings
- A Converter settings supplier.public Converter(Supplier<InputStream> document, com.groupdocs.conversion.contracts.LoadOptionsForFileTypeProvider loadOptions)
document
- An input stream supplier.loadOptions
- The function that return document load options.public Converter(Supplier<InputStream> document, com.groupdocs.conversion.contracts.LoadOptionsForFileTypeProvider loadOptions, ConverterSettingsProvider settings)
document
- A supplier that returns readable stream.loadOptions
- A function that returns document load options.settings
- A Converter settings supplier.public Converter(String filePath)
Initializes new instance of Converter
class.
filePath
- The file path to the source document.public Converter(String filePath, ConverterSettingsProvider settings)
Initializes new instance of Converter
class.
filePath
- The file path to the source document.settings
- A Converter settings supplier.@Deprecated public Converter(String filePath, ConverterSettings settings)
public Converter(String filePath, com.groupdocs.conversion.contracts.LoadOptionsProvider loadOptions)
Initializes new instance of Converter
class.
filePath
- The file path to the source document.loadOptions
- The load options supplier.@Deprecated public Converter(String filePath, LoadOptions loadOptions)
public Converter(String filePath, com.groupdocs.conversion.contracts.LoadOptionsProvider loadOptions, ConverterSettingsProvider settings)
Initializes new instance of Converter
class.
filePath
- The file path to the source document.loadOptions
- The document load options supplier.settings
- The Converter settings supplier.@Deprecated public Converter(String filePath, LoadOptions loadOptions, ConverterSettings settings)
public Converter(String filePath, com.groupdocs.conversion.contracts.LoadOptionsForFileTypeProvider loadOptions)
filePath
- The file path to the source document.loadOptions
- The document load options function.public Converter(String filePath, com.groupdocs.conversion.contracts.LoadOptionsForFileTypeProvider loadOptions, ConverterSettingsProvider settings)
filePath
- The file path to the source document.loadOptions
- The document load options function.settings
- The Converter settings supplier.public static void tweakPackageUtil(String vendor, String version, String specTitle) throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException, ClassNotFoundException
public final void convert(SaveDocumentStream document, ConvertOptions convertOptions)
Converts source document. Saves the whole converted document.
document
- The output stream supplier.convertOptions
- The convert options specific to desired target file type.public void convert(SaveDocumentStream document, ConvertedDocumentStream documentCompleted, ConvertOptions convertOptions)
document
- output stream supplierdocumentCompleted
- the delegate that receive converted document stream.convertOptions
- the convert options specific to desired target file type.public void convert(SaveDocumentStream document, ConvertOptionsProvider convertOptionsProvider)
document
- The output stream supplier.convertOptionsProvider
- Convert options provider. Will be called for each conversion to provide specific convert options to desired target document type.public void convert(SaveDocumentStream document, ConvertedDocumentStream documentCompleted, ConvertOptionsProvider convertOptionsProvider)
document
- The output stream supplier.documentCompleted
- The delegate that receive converted document stream.convertOptionsProvider
- Convert options provider. Will be called for each conversion to provide specific convert options to desired target document type.public void convert(SaveDocumentStreamForFileType document, ConvertOptions convertOptions)
document
- Output stream function.convertOptions
- The convert options specific to desired target file type.public void convert(SaveDocumentStreamForFileType document, ConvertedDocumentStream documentCompleted, ConvertOptions convertOptions)
document
- Output stream functiondocumentCompleted
- The delegate that receive converted document streamconvertOptions
- The convert options specific to desired target file typepublic void convert(SaveDocumentStreamForFileType document, ConvertOptionsProvider convertOptionsProvider)
document
- Output stream function.convertOptionsProvider
- Convert options provider. Will be called for each conversion to provide specific convert options to desired target document type.public void convert(SaveDocumentStreamForFileType document, ConvertedDocumentStream documentCompleted, ConvertOptionsProvider convertOptionsProvider)
document
- Output stream function.documentCompleted
- The delegate that receive converted document stream.convertOptionsProvider
- Convert options provider. Will be called for each conversion to provide specific convert options to desired target document type.public final void convert(String filePath, ConvertOptions convertOptions)
Converts source document. Saves the whole converted document.
filePath
- The file path to the source document.convertOptions
- The convert options specific to desired target file type.public final void convert(SavePageStream document, ConvertOptions convertOptions)
Converts source document. Saves the converted document page by page.
document
- The page output stream function.convertOptions
- The convert options specific to desired target file type.public void convert(SavePageStream document, ConvertedPageStream documentCompleted, ConvertOptions convertOptions)
document
- The output stream function.documentCompleted
- The delegate that receive converted document page stream.convertOptions
- The convert options specific to desired target file type.public void convert(SavePageStream document, ConvertOptionsProvider convertOptionsProvider)
document
- The output stream function.convertOptionsProvider
- Convert options provider. Will be called for each conversion to provide specific convert options to desired target document type.public void convert(SavePageStream document, ConvertedPageStream documentCompleted, ConvertOptionsProvider convertOptionsProvider)
document
- Output stream function.documentCompleted
- The delegate that receive converted document page stream.convertOptionsProvider
- Convert options provider. Will be called for each conversion to provide specific convert options to desired target document type.public void convert(SavePageStreamForFileType document, ConvertOptions convertOptions)
document
- An output stream function.convertOptions
- The convert options specific to desired target file type.public void convert(SavePageStreamForFileType document, ConvertedPageStream documentCompleted, ConvertOptions convertOptions)
document
- An output stream function.documentCompleted
- The delegate that receive converted document page stream.convertOptions
- The convert options specific to desired target file type.public void convert(SavePageStreamForFileType document, ConvertOptionsProvider convertOptionsProvider)
document
- An output stream function.convertOptionsProvider
- Convert options provider. Will be called for each conversion to provide specific convert options to desired target document type.public void convert(SavePageStreamForFileType document, ConvertedPageStream documentCompleted, ConvertOptionsProvider convertOptionsProvider)
document
- An output stream function.documentCompleted
- The delegate that receive converted document page stream.convertOptionsProvider
- Convert options provider. Will be called for each conversion to provide specific convert options to desired target document type.@Deprecated public final void convert(OutputStream document, ConvertOptions convertOptions)
@Deprecated public void convert(OutputStream document, ConvertedDocumentStream documentCompleted, ConvertOptions convertOptions)
@Deprecated public final void convertPageByPage(OutputStream document, ConvertOptions convertOptions)
@Deprecated public void convert(OutputStream document, ConvertedPageStream documentCompleted, ConvertOptions convertOptions)
@Deprecated public void convert(OutputStream document, ConvertOptionsProvider convertOptionsProvider)
public com.groupdocs.conversion.fluent.IConversionFrom withSettings(ConverterSettingsProvider settingsProvider)
public com.groupdocs.conversion.fluent.IConversionLoadOptionsOrSourceDocumentLoaded load(String fileName)
public com.groupdocs.conversion.fluent.IConversionLoadOptionsOrSourceDocumentLoaded load(String[] fileNames)
public com.groupdocs.conversion.fluent.IConversionLoadOptionsOrSourceDocumentLoaded load(DocumentStreamProvider documentStreamProvider)
public com.groupdocs.conversion.fluent.IConversionLoadOptionsOrSourceDocumentLoaded load(DocumentStreamsProvider documentStreamProvider)
public final IDocumentInfo getDocumentInfo()
Gets source document info - pages count and other document properties specific to the file type.
public final PossibleConversions getPossibleConversions()
Gets possible conversions for the source document.
public static List<PossibleConversions> getAllPossibleConversions()
public static PossibleConversions getPossibleConversions(String extension)
extension
- Document extensionpublic final void dispose()
Releases resources.
public void close()
close
in interface Closeable
close
in interface AutoCloseable