public class Converter extends Object implements Closeable
Represents main class that controls document conversion process.
| Constructor and Description |
|---|
Converter()
Initializes new instance of
|
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(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 |
dispose()
Releases resources.
|
protected void |
finalize()
finalizer
|
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
|
boolean |
isDocumentPasswordProtected()
Checks is source document is password protected
|
IConversionLoadOptionsOrSourceDocumentLoaded |
load(DocumentStreamProvider documentStreamProvider) |
IConversionLoadOptionsOrSourceDocumentLoaded |
load(DocumentStreamsProvider documentStreamProvider) |
IConversionLoadOptionsOrSourceDocumentLoaded |
load(String fileName) |
IConversionLoadOptionsOrSourceDocumentLoaded |
load(String[] fileNames) |
static void |
tweakPackageUtil(String vendor,
String version,
String specTitle) |
IConversionFrom |
withSettings(ConverterSettingsProvider settingsProvider) |
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(String filePath)
Initializes new instance of Converter class.
filePath - The file path to the source document.@Deprecated public Converter(String filePath, ConverterSettings settings)
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, LoadOptions loadOptions)
@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 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.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.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.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(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 void close()
close in interface Closeableclose in interface AutoCloseablepublic 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, 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 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, 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(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, 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 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, 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(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, 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 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, 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(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, 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.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, 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 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 dispose()
Releases resources.
protected void finalize()
throws Throwable
finalizer
public static List<PossibleConversions> getAllPossibleConversions()
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 PossibleConversions getPossibleConversions(String extension)
extension - Document extensionpublic boolean isDocumentPasswordProtected()
public IConversionLoadOptionsOrSourceDocumentLoaded load(DocumentStreamProvider documentStreamProvider)
public IConversionLoadOptionsOrSourceDocumentLoaded load(DocumentStreamsProvider documentStreamProvider)
public IConversionLoadOptionsOrSourceDocumentLoaded load(String fileName)
public IConversionLoadOptionsOrSourceDocumentLoaded load(String[] fileNames)
public static void tweakPackageUtil(String vendor, String version, String specTitle) throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException, ClassNotFoundException
public IConversionFrom withSettings(ConverterSettingsProvider settingsProvider)
Copyright © 2024. All rights reserved.