com.groupdocs.conversion.handler

## Class ConversionHandler

- java.lang.Object
- - com.groupdocs.conversion.handler.ConversionHandler

-     public class ConversionHandler
      extends Object

  Create instance of ConversionHandler class to convert between different file formats

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `com.aspose.ms.lang.Event<ConversionCompleteHandler>` | `ConversionComplete`
    `com.aspose.ms.lang.Event<ConversionProgressHandler>` | `ConversionProgress`
    `com.aspose.ms.lang.Event<ConversionStartHandler>` | `ConversionStart`
    `com.groupdocs.conversion.handler.LocaleHandler` | `LocaleHandler` Locale handler

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ConversionHandler(ConversionConfig conversionConfig)` Instantiate the ConversionHandler with default `IInputDataHandler`, `IOutputDataHandler` and `ICacheDataHandler` All files will be loaded from local file system All cache items will be stored and loaded from local data system
    `ConversionHandler(ConversionConfig conversionConfig, ICacheDataHandler cacheDataHandler)` Instantiate the ConversionHandler with default `IInputDataHandler`, `IOutputDataHandler` and custom `ICacheDataHandler` implementation
    `ConversionHandler(ConversionConfig conversionConfig, IInputDataHandler inputDataHandler)` Instantiate the ConversionHandler with default `IOutputDataHandler`, `ICacheDataHandler` and custom `IInputDataHandler` implementation
    `ConversionHandler(ConversionConfig conversionConfig, IInputDataHandler inputDataHandler, ICacheDataHandler cacheDataHandler)` Instantiate the ConversionHandler with default `IOutputDataHandler` and custom `IInputDataHandler`, `ICacheDataHandler` implementation
    `ConversionHandler(ConversionConfig conversionConfig, IInputDataHandler inputDataHandler, IOutputDataHandler outputDataHandler)` Instantiate the ConversionHandler with default `ICacheDataHandler` and custom `IInputDataHandler`, `IOutputDataHandler` implementation
    `ConversionHandler(ConversionConfig conversionConfig, IInputDataHandler inputDataHandler, IOutputDataHandler outputDataHandler, ICacheDataHandler cacheDataHandler)` Instantiate the ConversionHandler with custom `IInputDataHandler`, `IOutputDataHandler` and custom `ICacheDataHandler` implementations
    `ConversionHandler(ConversionConfig conversionConfig, IOutputDataHandler outputDataHandler)` Instantiate the ConversionHandler with default `IInputDataHandler`, `ICacheDataHandler` and custom `IOutputDataHandler` implementation
    `ConversionHandler(ConversionConfig conversionConfig, IOutputDataHandler outputDataHandler, ICacheDataHandler cacheDataHandler)` Instantiate the ConversionHandler with default `IInputDataHandler` and custom `IOutputDataHandler`, `ICacheDataHandler` implementation
    `ConversionHandler(ConversionConfig conversionConfig, IOutputDataHandler outputDataHandler, ICacheDataHandler cacheDataHandler, com.groupdocs.conversion.converter.IConverterFactory converterFactory, com.groupdocs.conversion.domain.IDocumentLoader documentLoader)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `<T> T` | `convert(InputStream fileStream, LoadOptions loadOptions, SaveOptions saveOptions)` Converts the content of the stream
    `<T> T` | `convert(InputStream fileStream, SaveOptions saveOptions)` Converts the content of the stream
    `<T> T` | `convert(InputStream fileStream, String fileName, LoadOptions loadOptions, SaveOptions saveOptions)` Converts the content of the stream
    `<T> T` | `convert(InputStream fileStream, String fileName, SaveOptions saveOptions)` Converts the content of the stream
    `<T> T` | `convert(String guid, LoadOptions loadOptions, SaveOptions saveOptions)` Converts the file specified by the guid
    `<T> T` | `convert(String guid, SaveOptions saveOptions)` Converts the file specified by the guid
    `ICacheDataHandler` | `getCacheDataHandler()` Cache data handler
    `ConversionConfig` | `getConfig()` Conversion config
    `com.groupdocs.conversion.converter.IConverterFactory` | `getConverterFactory()` Converter factory
    `com.groupdocs.conversion.domain.IDocumentLoader` | `getDocumentLoader()` Document loader
    `int` | `getDocumentPagesCount(InputStream fileStream)` Returns pages count of the provided document
    `int` | `getDocumentPagesCount(InputStream fileStream, LoadOptions loadOptions)` Returns pages count of the provided document
    `int` | `getDocumentPagesCount(String guid)` Returns pages count of the provided document
    `int` | `getDocumentPagesCount(String guid, LoadOptions loadOptions)` Returns pages count of the provided document
    `static com.groupdocs.foundation.handler.FoundationHandler` | `getFoundationHandler()` Foundation handler
    `IOutputDataHandler` | `getOutputDataHandler()` Output data handler
    `String[]` | `getPossibleConversions(InputStream sourceDocument)` Return all possible conversions for provided source document type
    `String[]` | `getPossibleConversions(String sourceDocumentExtension)` Return all possible conversions for provided source document type
    `Dictionary<String,SaveOptions>` | `getSaveOptions(InputStream sourceDocument)` Returns all possible SaveOptions for provided source document type
    `Dictionary<String,SaveOptions>` | `getSaveOptions(String sourceDocumentExtension)` Returns all possible SaveOptions for provided source document type
    `boolean` | `isLicensed()` Indicates is the product licensed or not
    `void` | `setConversionProgressListener(IConversionProgressListener progressListener)` Set conversion progress listener
    `void` | `setConversionStatusListener(IConversionStatusListener statusListener)` Set conversion status listener

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### LocaleHandler

          public com.groupdocs.conversion.handler.LocaleHandler LocaleHandler

      Locale handler

    - #### ConversionStart

          public final com.aspose.ms.lang.Event<ConversionStartHandler> ConversionStart

    - #### ConversionProgress

          public final com.aspose.ms.lang.Event<ConversionProgressHandler> ConversionProgress

    - #### ConversionComplete

          public final com.aspose.ms.lang.Event<ConversionCompleteHandler> ConversionComplete

  - ### Constructor Detail

    - #### ConversionHandler

          public ConversionHandler(ConversionConfig conversionConfig)

      Instantiate the ConversionHandler with default `IInputDataHandler`, `IOutputDataHandler` and `ICacheDataHandler` All files will be loaded from local file system All cache items will be stored and loaded from local data system

      Parameters:
        `conversionConfig` - Instance of `ConversionConfig`

    - #### ConversionHandler

          public ConversionHandler(ConversionConfig conversionConfig,
                           IInputDataHandler inputDataHandler)

      Instantiate the ConversionHandler with default `IOutputDataHandler`, `ICacheDataHandler` and custom `IInputDataHandler` implementation

      Parameters:
        `conversionConfig` - Instance of `ConversionConfig`
        `inputDataHandler` - Custom implementation of `IInputDataHandler` interface

    - #### ConversionHandler

          public ConversionHandler(ConversionConfig conversionConfig,
                           ICacheDataHandler cacheDataHandler)

      Instantiate the ConversionHandler with default `IInputDataHandler`, `IOutputDataHandler` and custom `ICacheDataHandler` implementation

      Parameters:
        `conversionConfig` - Instance of `ConversionConfig`
        `cacheDataHandler` - Custom implementation of `IInputDataHandler` interface

    - #### ConversionHandler

          public ConversionHandler(ConversionConfig conversionConfig,
                           IOutputDataHandler outputDataHandler)

      Instantiate the ConversionHandler with default `IInputDataHandler`, `ICacheDataHandler` and custom `IOutputDataHandler` implementation

      Parameters:
        `conversionConfig` - Instance of `ConversionConfig`
        `outputDataHandler` - Custom implementation of `IOutputDataHandler` interface

    - #### ConversionHandler

          public ConversionHandler(ConversionConfig conversionConfig,
                           IInputDataHandler inputDataHandler,
                           IOutputDataHandler outputDataHandler)

      Instantiate the ConversionHandler with default `ICacheDataHandler` and custom `IInputDataHandler`, `IOutputDataHandler` implementation

      Parameters:
        `conversionConfig` - Instance of `ConversionConfig`
        `inputDataHandler` - Custom implementation of `IInputDataHandler` interface
        `outputDataHandler` - Custom implementation of `IOutputDataHandler` interface

    - #### ConversionHandler

          public ConversionHandler(ConversionConfig conversionConfig,
                           IInputDataHandler inputDataHandler,
                           ICacheDataHandler cacheDataHandler)

      Instantiate the ConversionHandler with default `IOutputDataHandler` and custom `IInputDataHandler`, `ICacheDataHandler` implementation

      Parameters:
        `conversionConfig` - Instance of `ConversionConfig`
        `inputDataHandler` - Custom implementation of `IInputDataHandler` interface
        `cacheDataHandler` - Custom implementation of `ICacheDataHandler` interface

    - #### ConversionHandler

          public ConversionHandler(ConversionConfig conversionConfig,
                           IOutputDataHandler outputDataHandler,
                           ICacheDataHandler cacheDataHandler)

      Instantiate the ConversionHandler with default `IInputDataHandler` and custom `IOutputDataHandler`, `ICacheDataHandler` implementation

      Parameters:
        `conversionConfig` - Instance of `ConversionConfig`
        `outputDataHandler` - Custom implementation of `IOutputDataHandler` interface
        `cacheDataHandler` - Custom implementation of `ICacheDataHandler` interface

    - #### ConversionHandler

          public ConversionHandler(ConversionConfig conversionConfig,
                           IInputDataHandler inputDataHandler,
                           IOutputDataHandler outputDataHandler,
                           ICacheDataHandler cacheDataHandler)

      Instantiate the ConversionHandler with custom `IInputDataHandler`, `IOutputDataHandler` and custom `ICacheDataHandler` implementations

      Parameters:
        `conversionConfig` - Instance of `ConversionConfig`
        `inputDataHandler` - Custom implementation of `IInputDataHandler` interface
        `outputDataHandler` - Custom implementation of `IOutputDataHandler` interface
        `cacheDataHandler` - Custom implementation of `ICacheDataHandler` interface

    - #### ConversionHandler

          public ConversionHandler(ConversionConfig conversionConfig,
                           IOutputDataHandler outputDataHandler,
                           ICacheDataHandler cacheDataHandler,
                           com.groupdocs.conversion.converter.IConverterFactory converterFactory,
                           com.groupdocs.conversion.domain.IDocumentLoader documentLoader)

  - ### Method Detail

    - #### getConfig

          public ConversionConfig getConfig()

      Conversion config

      Returns:

    - #### getDocumentLoader

          public com.groupdocs.conversion.domain.IDocumentLoader getDocumentLoader()

      Document loader

      Returns:

    - #### getOutputDataHandler

          public IOutputDataHandler getOutputDataHandler()

      Output data handler

      Returns:

    - #### getCacheDataHandler

          public ICacheDataHandler getCacheDataHandler()

      Cache data handler

      Returns:

    - #### getFoundationHandler

          public static com.groupdocs.foundation.handler.FoundationHandler getFoundationHandler()

      Foundation handler

      Returns:

    - #### getConverterFactory

          public com.groupdocs.conversion.converter.IConverterFactory getConverterFactory()

      Converter factory

      Returns:

    - #### convert

          public <T> T convert(String guid,
                      LoadOptions loadOptions,
                      SaveOptions saveOptions)

      Converts the file specified by the guid

      Type Parameters:
        `T` -
      Parameters:
        `guid` -
        `loadOptions` -
        `saveOptions` -
      Returns:

    - #### convert

          public <T> T convert(String guid,
                      SaveOptions saveOptions)

      Converts the file specified by the guid

      Type Parameters:
        `T` -
      Parameters:
        `guid` -
        `saveOptions` -
      Returns:

    - #### convert

          public <T> T convert(InputStream fileStream,
                      String fileName,
                      LoadOptions loadOptions,
                      SaveOptions saveOptions)

      Converts the content of the stream

      Type Parameters:
        `T` -
      Parameters:
        `fileStream` -
        `fileName` -
        `loadOptions` -
        `saveOptions` -
      Returns:

    - #### convert

          public <T> T convert(InputStream fileStream,
                      String fileName,
                      SaveOptions saveOptions)

      Converts the content of the stream

      Type Parameters:
        `T` -
      Parameters:
        `fileStream` -
        `fileName` -
        `saveOptions` -
      Returns:

    - #### convert

          public <T> T convert(InputStream fileStream,
                      LoadOptions loadOptions,
                      SaveOptions saveOptions)

      Converts the content of the stream

      Type Parameters:
        `T` -
      Parameters:
        `fileStream` -
        `loadOptions` -
        `saveOptions` -
      Returns:

    - #### convert

          public <T> T convert(InputStream fileStream,
                      SaveOptions saveOptions)

      Converts the content of the stream

      Type Parameters:
        `T` -
      Parameters:
        `fileStream` -
        `saveOptions` -

        `T`:

      Returns:

    - #### setConversionProgressListener

          public void setConversionProgressListener(IConversionProgressListener progressListener)

      Set conversion progress listener

      Parameters:
        `progressListener` -

    - #### setConversionStatusListener

          public void setConversionStatusListener(IConversionStatusListener statusListener)

      Set conversion status listener

      Parameters:
        `statusListener` -

    - #### getSaveOptions

          public Dictionary<String,SaveOptions> getSaveOptions(String sourceDocumentExtension)

      Returns all possible SaveOptions for provided source document type

      Parameters:
        `sourceDocumentExtension` - Source document extension
      Returns:

    - #### getSaveOptions

          public Dictionary<String,SaveOptions> getSaveOptions(InputStream sourceDocument)

      Returns all possible SaveOptions for provided source document type

      Parameters:
        `sourceDocument` - Source document stream
      Returns:

    - #### getPossibleConversions

          public String[] getPossibleConversions(String sourceDocumentExtension)

      Return all possible conversions for provided source document type

      Parameters:
        `sourceDocumentExtension` - Source document extension
      Returns:

    - #### getPossibleConversions

          public String[] getPossibleConversions(InputStream sourceDocument)

      Return all possible conversions for provided source document type

      Parameters:
        `sourceDocument` - Source document stream
      Returns:

    - #### isLicensed

          public boolean isLicensed()

      Indicates is the product licensed or not

      Returns:

    - #### getDocumentPagesCount

          public int getDocumentPagesCount(String guid)

      Returns pages count of the provided document

      Parameters:
        `guid` -
      Returns:
        pages count

    - #### getDocumentPagesCount

          public int getDocumentPagesCount(String guid,
                                  LoadOptions loadOptions)

      Returns pages count of the provided document

      Parameters:
        `guid` -
        `loadOptions` -
      Returns:
        pages count

    - #### getDocumentPagesCount

          public int getDocumentPagesCount(InputStream fileStream,
                                  LoadOptions loadOptions)

      Returns pages count of the provided document

      Parameters:
        `fileStream` -
        `loadOptions` -
      Returns:
        pages count

    - #### getDocumentPagesCount

          public int getDocumentPagesCount(InputStream fileStream)

      Returns pages count of the provided document

      Parameters:
        `fileStream` -
      Returns:
        pages count

Copyright © 2017. All rights reserved.