Converter
Inheritance: java.lang.Object
All Implemented Interfaces: java.io.Closeable
public class Converter implements Closeable
Represents main class that controls document conversion process.
Constructors
Methods
How to get supported conversions in code: https://docs.groupdocs.com/display/conversionnet/Get+possible+conversions | | getPossibleConversions(String extension) | Gets supported conversions for provided document extension Converter.GetPossibleConversions(".docx") Converter.GetPossibleConversions(“docx”)Learn moreLearn more about supported conversions: Full list of supported conversionsLearn more about available conversions: How to get supported conversions in code
How to get supported conversions in code: https://docs.groupdocs.com/display/conversionnet/Get+possible+conversions | | dispose() | Releases resources. | | close() | |
Converter()
public Converter()
Initializes new instance of class for fluent conversion setup. Sample fluent conversion usage: 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();
Converter(Supplier document)
public Converter(Supplier<InputStream> document)
Initializes new instance of Converter class.
Learn moreMore about how to load and convert documents stored at FTP, Amazon S3 Storage, Windows Azure or any other third-party storage: Loading document from different sourcesMore about document loading options dependent on file type: Load options for different document types
Parameters:
Parameter | Type | Description |
---|---|---|
document | java.util.function.Supplier<java.io.InputStream> | input stream supplier. |
Converter(Supplier document, ConverterSettingsProvider settings)
public Converter(Supplier<InputStream> document, ConverterSettingsProvider settings)
Initializes new instance of Converter class.
Learn moreMore about how to load and convert documents stored at FTP, Amazon S3 Storage, Windows Azure or any other third-party storage: Loading document from different sourcesMore about document loading options dependent on file type: Load options for different document types
Parameters:
Parameter | Type | Description |
---|---|---|
document | java.util.function.Supplier<java.io.InputStream> | An input stream supplier. |
settings | ConverterSettingsProvider | A Converter settings supplier. |
Converter(Supplier document, LoadOptionsProvider loadOptions)
public Converter(Supplier<InputStream> document, LoadOptionsProvider loadOptions)
Initializes new instance of Converter class.
Learn moreMore about how to load and convert documents stored at FTP, Amazon S3 Storage, Windows Azure or any other third-party storage: Loading document from different sourcesMore about document loading options dependent on file type: Load options for different document types
Parameters:
Parameter | Type | Description |
---|---|---|
document | java.util.function.Supplier<java.io.InputStream> | An input stream supplier. |
loadOptions | LoadOptionsProvider | A load options supplier. |
Converter(Supplier document, LoadOptionsProvider loadOptions, ConverterSettingsProvider settings)
public Converter(Supplier<InputStream> document, LoadOptionsProvider loadOptions, ConverterSettingsProvider settings)
Initializes new instance of Converter class.
Learn moreMore about how to load and convert documents stored at FTP, Amazon S3 Storage, Windows Azure or any other third-party storage: Loading document from different sourcesMore about document loading options dependent on file type: Load options for different document types
Parameters:
Parameter | Type | Description |
---|---|---|
document | java.util.function.Supplier<java.io.InputStream> | An input stream supplier. |
loadOptions | LoadOptionsProvider | A document load options supplier. |
settings | ConverterSettingsProvider | A Converter settings supplier. |
Converter(Supplier document, LoadOptionsForFileTypeProvider loadOptions)
public Converter(Supplier<InputStream> document, LoadOptionsForFileTypeProvider loadOptions)
Initializes new instance of class.Learn moreMore about how to load and convert documents stored at FTP, Amazon S3 Storage, Windows Azure or any other third-party storage: Loading document from different sourcesMore about document loading options dependent on file type: Load options for different document types
Parameters:
Parameter | Type | Description |
---|---|---|
document | java.util.function.Supplier<java.io.InputStream> | An input stream supplier. |
loadOptions | LoadOptionsForFileTypeProvider | The function that return document load options. |
Converter(Supplier document, LoadOptionsForFileTypeProvider loadOptions, ConverterSettingsProvider settings)
public Converter(Supplier<InputStream> document, LoadOptionsForFileTypeProvider loadOptions, ConverterSettingsProvider settings)
Initializes new instance of class.Learn moreMore about how to load and convert documents stored at FTP, Amazon S3 Storage, Windows Azure or any other third-party storage: Loading document from different sourcesMore about document loading options dependent on file type: Load options for different document types
Parameters:
Parameter | Type | Description |
---|---|---|
document | java.util.function.Supplier<java.io.InputStream> | A supplier that returns readable stream. |
loadOptions | LoadOptionsForFileTypeProvider | A function that returns document load options. |
settings | ConverterSettingsProvider | A Converter settings supplier. |
Converter(String filePath)
public Converter(String filePath)
Initializes new instance of Converter class.
Learn moreMore about how to load and convert documents stored at FTP, Amazon S3 Storage, Windows Azure or any other third-party storage: Loading document from different sourcesMore about document loading options dependent on file type: Load options for different document types
Parameters:
Parameter | Type | Description |
---|---|---|
filePath | java.lang.String | The file path to the source document. |
Converter(String filePath, ConverterSettingsProvider settings)
public Converter(String filePath, ConverterSettingsProvider settings)
Initializes new instance of Converter class.
Learn moreMore about how to load and convert documents stored at FTP, Amazon S3 Storage, Windows Azure or any other third-party storage: Loading document from different sourcesMore about document loading options dependent on file type: Load options for different document types
Parameters:
Parameter | Type | Description |
---|---|---|
filePath | java.lang.String | The file path to the source document. |
settings | ConverterSettingsProvider | A Converter settings supplier. |
Converter(String filePath, LoadOptionsProvider loadOptions)
public Converter(String filePath, LoadOptionsProvider loadOptions)
Initializes new instance of Converter class.
Learn moreMore about how to load and convert documents stored at FTP, Amazon S3 Storage, Windows Azure or any other third-party storage: Loading document from different sourcesMore about document loading options dependent on file type: Load options for different document types
Parameters:
Parameter | Type | Description |
---|---|---|
filePath | java.lang.String | The file path to the source document. |
loadOptions | LoadOptionsProvider | The load options supplier. |
Converter(String filePath, LoadOptionsProvider loadOptions, ConverterSettingsProvider settings)
public Converter(String filePath, LoadOptionsProvider loadOptions, ConverterSettingsProvider settings)
Initializes new instance of Converter class.
Learn moreMore about how to load and convert documents stored at FTP, Amazon S3 Storage, Windows Azure or any other third-party storage: Loading document from different sourcesMore about document loading options dependent on file type: Load options for different document types
Parameters:
Parameter | Type | Description |
---|---|---|
filePath | java.lang.String | The file path to the source document. |
loadOptions | LoadOptionsProvider | The document load options supplier. |
settings | ConverterSettingsProvider | The Converter settings supplier. |
Converter(String filePath, LoadOptionsForFileTypeProvider loadOptions)
public Converter(String filePath, LoadOptionsForFileTypeProvider loadOptions)
Initializes new instance of class.Learn moreMore about how to load and convert documents stored at FTP, Amazon S3 Storage, Windows Azure or any other third-party storage: Loading document from different sourcesMore about document loading options dependent on file type: Load options for different document types
Parameters:
Parameter | Type | Description |
---|---|---|
filePath | java.lang.String | The file path to the source document. |
loadOptions | LoadOptionsForFileTypeProvider | The document load options function. |
Converter(String filePath, LoadOptionsForFileTypeProvider loadOptions, ConverterSettingsProvider settings)
public Converter(String filePath, LoadOptionsForFileTypeProvider loadOptions, ConverterSettingsProvider settings)
Initializes new instance of class.Learn moreMore about how to load and convert documents stored at FTP, Amazon S3 Storage, Windows Azure or any other third-party storage: Loading document from different sourcesMore about document loading options dependent on file type: Load options for different document types
Parameters:
Parameter | Type | Description |
---|---|---|
filePath | java.lang.String | The file path to the source document. |
loadOptions | LoadOptionsForFileTypeProvider | The document load options function. |
settings | ConverterSettingsProvider | The Converter settings supplier. |
tweakPackageUtil(String vendor, String version, String specTitle)
public static void tweakPackageUtil(String vendor, String version, String specTitle)
Parameters:
Parameter | Type | Description |
---|---|---|
vendor | java.lang.String | |
version | java.lang.String | |
specTitle | java.lang.String |
convert(SaveDocumentStream document, ConvertOptions convertOptions)
public final void convert(SaveDocumentStream document, ConvertOptions convertOptions)
Converts source document. Saves the whole converted document.
Learn moreMore about document conversion basic scenarios: How to convert document in 3 stepsConversion use cases, advanced settings and customizations: Convert document with advanced settings
Parameters:
Parameter | Type | Description |
---|---|---|
document | SaveDocumentStream | The output stream supplier. |
convertOptions | com.groupdocs.conversion.options.convert.ConvertOptions | The convert options specific to desired target file type. |
convert(SaveDocumentStream document, ConvertedDocumentStream documentCompleted, ConvertOptions convertOptions)
public void convert(SaveDocumentStream document, ConvertedDocumentStream documentCompleted, ConvertOptions convertOptions)
Converts source document. Saves the whole converted document. Learn moreMore about document conversion basic scenarios: How to convert document in 3 stepsConversion use cases, advanced settings and customizations: Convert document with advanced settings
Parameters:
Parameter | Type | Description |
---|---|---|
document | SaveDocumentStream | output stream supplier |
documentCompleted | ConvertedDocumentStream | the delegate that receive converted document stream. |
convertOptions | com.groupdocs.conversion.options.convert.ConvertOptions | the convert options specific to desired target file type. |
convert(SaveDocumentStream document, ConvertOptionsProvider convertOptionsProvider)
public void convert(SaveDocumentStream document, ConvertOptionsProvider convertOptionsProvider)
Converts source document. Saves the whole converted document.Learn moreMore about document conversion basic scenarios: How to convert document in 3 stepsConversion use cases, advanced settings and customizations: Convert document with advanced settings
Parameters:
Parameter | Type | Description |
---|---|---|
document | SaveDocumentStream | The output stream supplier. |
convertOptionsProvider | ConvertOptionsProvider | Convert options provider. Will be called for each conversion to provide specific convert options to desired target document type. |
convert(SaveDocumentStream document, ConvertedDocumentStream documentCompleted, ConvertOptionsProvider convertOptionsProvider)
public void convert(SaveDocumentStream document, ConvertedDocumentStream documentCompleted, ConvertOptionsProvider convertOptionsProvider)
Converts source document. Saves the whole converted document.Learn moreMore about document conversion basic scenarios: How to convert document in 3 stepsConversion use cases, advanced settings and customizations: Convert document with advanced settings
Parameters:
Parameter | Type | Description |
---|---|---|
document | SaveDocumentStream | The output stream supplier. |
documentCompleted | ConvertedDocumentStream | The delegate that receive converted document stream. |
convertOptionsProvider | ConvertOptionsProvider | Convert options provider. Will be called for each conversion to provide specific convert options to desired target document type. |
convert(SaveDocumentStreamForFileType document, ConvertOptions convertOptions)
public void convert(SaveDocumentStreamForFileType document, ConvertOptions convertOptions)
Converts source document. Saves the whole converted document.Learn moreMore about document conversion basic scenarios: How to convert document in 3 stepsConversion use cases, advanced settings and customizations: Convert document with advanced settings
Parameters:
Parameter | Type | Description |
---|---|---|
document | SaveDocumentStreamForFileType | Output stream function. |
convertOptions | com.groupdocs.conversion.options.convert.ConvertOptions | The convert options specific to desired target file type. |
convert(SaveDocumentStreamForFileType document, ConvertedDocumentStream documentCompleted, ConvertOptions convertOptions)
public void convert(SaveDocumentStreamForFileType document, ConvertedDocumentStream documentCompleted, ConvertOptions convertOptions)
Converts source document. Saves the whole converted document.Learn moreMore about document conversion basic scenarios: How to convert document in 3 stepsConversion use cases, advanced settings and customizations: Convert document with advanced settings
Parameters:
Parameter | Type | Description |
---|---|---|
document | SaveDocumentStreamForFileType | Output stream function |
documentCompleted | ConvertedDocumentStream | The delegate that receive converted document stream |
convertOptions | com.groupdocs.conversion.options.convert.ConvertOptions | The convert options specific to desired target file type |
convert(SaveDocumentStreamForFileType document, ConvertOptionsProvider convertOptionsProvider)
public void convert(SaveDocumentStreamForFileType document, ConvertOptionsProvider convertOptionsProvider)
Converts source document. Saves the whole converted document.Learn moreMore about document conversion basic scenarios: How to convert document in 3 stepsConversion use cases, advanced settings and customizations: Convert document with advanced settings
Parameters:
Parameter | Type | Description |
---|---|---|
document | SaveDocumentStreamForFileType | Output stream function. |
convertOptionsProvider | ConvertOptionsProvider | Convert options provider. Will be called for each conversion to provide specific convert options to desired target document type. |
convert(SaveDocumentStreamForFileType document, ConvertedDocumentStream documentCompleted, ConvertOptionsProvider convertOptionsProvider)
public void convert(SaveDocumentStreamForFileType document, ConvertedDocumentStream documentCompleted, ConvertOptionsProvider convertOptionsProvider)
Converts source document. Saves the whole converted document.Learn moreMore about document conversion basic scenarios: How to convert document in 3 stepsConversion use cases, advanced settings and customizations: Convert document with advanced settings
Parameters:
Parameter | Type | Description |
---|---|---|
document | SaveDocumentStreamForFileType | Output stream function. |
documentCompleted | ConvertedDocumentStream | The delegate that receive converted document stream. |
convertOptionsProvider | ConvertOptionsProvider | Convert options provider. Will be called for each conversion to provide specific convert options to desired target document type. |
convert(String filePath, ConvertOptions convertOptions)
public final void convert(String filePath, ConvertOptions convertOptions)
Converts source document. Saves the whole converted document.
Learn moreMore about document conversion basic scenarios: How to convert document in 3 stepsConversion use cases, advanced settings and customizations: Convert document with advanced settings
Parameters:
Parameter | Type | Description |
---|---|---|
filePath | java.lang.String | The file path to the source document. |
convertOptions | com.groupdocs.conversion.options.convert.ConvertOptions | The convert options specific to desired target file type. |
convert(SavePageStream document, ConvertOptions convertOptions)
public final void convert(SavePageStream document, ConvertOptions convertOptions)
Converts source document. Saves the converted document page by page.
Learn moreMore about document conversion basic scenarios: How to convert document in 3 stepsConversion use cases, advanced settings and customizations: Convert document with advanced settings
Parameters:
Parameter | Type | Description |
---|---|---|
document | SavePageStream | The page output stream function. |
convertOptions | com.groupdocs.conversion.options.convert.ConvertOptions | The convert options specific to desired target file type. |
convert(SavePageStream document, ConvertedPageStream documentCompleted, ConvertOptions convertOptions)
public void convert(SavePageStream document, ConvertedPageStream documentCompleted, ConvertOptions convertOptions)
Converts source document. Saves the converted document page by page. Learn moreMore about document conversion basic scenarios: How to convert document in 3 stepsConversion use cases, advanced settings and customizations: Convert document with advanced settings
Parameters:
Parameter | Type | Description |
---|---|---|
document | SavePageStream | The output stream function. |
documentCompleted | ConvertedPageStream | The delegate that receive converted document page stream. |
convertOptions | com.groupdocs.conversion.options.convert.ConvertOptions | The convert options specific to desired target file type. |
convert(SavePageStream document, ConvertOptionsProvider convertOptionsProvider)
public void convert(SavePageStream document, ConvertOptionsProvider convertOptionsProvider)
Converts source document. Saves the converted document page by page.Learn moreMore about document conversion basic scenarios: How to convert document in 3 stepsConversion use cases, advanced settings and customizations: Convert document with advanced settings
Parameters:
Parameter | Type | Description |
---|---|---|
document | SavePageStream | The output stream function. |
convertOptionsProvider | ConvertOptionsProvider | Convert options provider. Will be called for each conversion to provide specific convert options to desired target document type. |
convert(SavePageStream document, ConvertedPageStream documentCompleted, ConvertOptionsProvider convertOptionsProvider)
public void convert(SavePageStream document, ConvertedPageStream documentCompleted, ConvertOptionsProvider convertOptionsProvider)
Converts source document. Saves the converted document page by page.Learn moreMore about document conversion basic scenarios: How to convert document in 3 stepsConversion use cases, advanced settings and customizations: Convert document with advanced settings
Parameters:
Parameter | Type | Description |
---|---|---|
document | SavePageStream | Output stream function. |
documentCompleted | ConvertedPageStream | The delegate that receive converted document page stream. |
convertOptionsProvider | ConvertOptionsProvider | Convert options provider. Will be called for each conversion to provide specific convert options to desired target document type. |
convert(SavePageStreamForFileType document, ConvertOptions convertOptions)
public void convert(SavePageStreamForFileType document, ConvertOptions convertOptions)
Converts source document. Saves the converted document page by page.Learn moreMore about document conversion basic scenarios: How to convert document in 3 stepsConversion use cases, advanced settings and customizations: Convert document with advanced settings
Parameters:
Parameter | Type | Description |
---|---|---|
document | SavePageStreamForFileType | An output stream function. |
convertOptions | com.groupdocs.conversion.options.convert.ConvertOptions | The convert options specific to desired target file type. |
convert(SavePageStreamForFileType document, ConvertedPageStream documentCompleted, ConvertOptions convertOptions)
public void convert(SavePageStreamForFileType document, ConvertedPageStream documentCompleted, ConvertOptions convertOptions)
Converts source document. Saves the converted document page by page.Learn moreMore about document conversion basic scenarios: How to convert document in 3 stepsConversion use cases, advanced settings and customizations: Convert document with advanced settings
Parameters:
Parameter | Type | Description |
---|---|---|
document | SavePageStreamForFileType | An output stream function. |
documentCompleted | ConvertedPageStream | The delegate that receive converted document page stream. |
convertOptions | com.groupdocs.conversion.options.convert.ConvertOptions | The convert options specific to desired target file type. |
convert(SavePageStreamForFileType document, ConvertOptionsProvider convertOptionsProvider)
public void convert(SavePageStreamForFileType document, ConvertOptionsProvider convertOptionsProvider)
Converts source document. Saves the converted document page by page.Learn moreMore about document conversion basic scenarios: How to convert document in 3 stepsConversion use cases, advanced settings and customizations: Convert document with advanced settings
Parameters:
Parameter | Type | Description |
---|---|---|
document | SavePageStreamForFileType | An output stream function. |
convertOptionsProvider | ConvertOptionsProvider | Convert options provider. Will be called for each conversion to provide specific convert options to desired target document type. |
convert(SavePageStreamForFileType document, ConvertedPageStream documentCompleted, ConvertOptionsProvider convertOptionsProvider)
public void convert(SavePageStreamForFileType document, ConvertedPageStream documentCompleted, ConvertOptionsProvider convertOptionsProvider)
Converts source document. Saves the converted document page by page.Learn moreMore about document conversion basic scenarios: How to convert document in 3 stepsConversion use cases, advanced settings and customizations: Convert document with advanced settings
Parameters:
Parameter | Type | Description |
---|---|---|
document | SavePageStreamForFileType | An output stream function. |
documentCompleted | ConvertedPageStream | The delegate that receive converted document page stream. |
convertOptionsProvider | ConvertOptionsProvider | Convert options provider. Will be called for each conversion to provide specific convert options to desired target document type. |
withSettings(ConverterSettingsProvider settingsProvider)
public IConversionFrom withSettings(ConverterSettingsProvider settingsProvider)
Parameters:
Parameter | Type | Description |
---|---|---|
settingsProvider | ConverterSettingsProvider |
Returns: IConversionFrom
load(String fileName)
public IConversionLoadOptionsOrSourceDocumentLoaded load(String fileName)
Parameters:
Parameter | Type | Description |
---|---|---|
fileName | java.lang.String |
Returns: IConversionLoadOptionsOrSourceDocumentLoaded
load(String[] fileNames)
public IConversionLoadOptionsOrSourceDocumentLoaded load(String[] fileNames)
Parameters:
Parameter | Type | Description |
---|---|---|
fileNames | java.lang.String[] |
Returns: IConversionLoadOptionsOrSourceDocumentLoaded
load(DocumentStreamProvider documentStreamProvider)
public IConversionLoadOptionsOrSourceDocumentLoaded load(DocumentStreamProvider documentStreamProvider)
Parameters:
Parameter | Type | Description |
---|---|---|
documentStreamProvider | DocumentStreamProvider |
Returns: IConversionLoadOptionsOrSourceDocumentLoaded
load(DocumentStreamsProvider documentStreamProvider)
public IConversionLoadOptionsOrSourceDocumentLoaded load(DocumentStreamsProvider documentStreamProvider)
Parameters:
Parameter | Type | Description |
---|---|---|
documentStreamProvider | DocumentStreamsProvider |
Returns: IConversionLoadOptionsOrSourceDocumentLoaded
getDocumentInfo()
public final IDocumentInfo getDocumentInfo()
Gets source document info - pages count and other document properties specific to the file type.
Learn moreLearn more about converted document - file type, pages count, creation date and many other format specific properties: How to get document info
Returns: IDocumentInfo - document info
isDocumentPasswordProtected()
public boolean isDocumentPasswordProtected()
Checks is source document is password protected
Returns: boolean - true if document is password protected Learn moreLearn more about converted document - file type, pages count, creation date and many other format specific properties: How to check is the document password protected
getPossibleConversions()
public final PossibleConversions getPossibleConversions()
Gets possible conversions for the source document.
Learn moreLearn more about supported conversions: Full list of supported conversionsLearn more about available conversions: How to get supported conversions in code
Returns: PossibleConversions - possible conversions
getAllPossibleConversions()
public static List<PossibleConversions> getAllPossibleConversions()
Gets all supported conversions Learn moreLearn more about supported conversions: Full list of supported conversionsLearn more about available conversions: How to get supported conversions in code
Returns: java.util.List<com.groupdocs.conversion.contracts.PossibleConversions> - supported conversions
getPossibleConversions(String extension)
public static PossibleConversions getPossibleConversions(String extension)
Gets supported conversions for provided document extension Converter.GetPossibleConversions(".docx") Converter.GetPossibleConversions(“docx”)Learn moreLearn more about supported conversions: Full list of supported conversionsLearn more about available conversions: How to get supported conversions in code
Parameters:
Parameter | Type | Description |
---|---|---|
extension | java.lang.String | Document extension |
Returns: PossibleConversions - possible conversions
dispose()
public final void dispose()
Releases resources.
close()
public void close()