Class Converter


  • public class Converter
    extends NativeObject

    The class to convert one or more images to a PDF document

    • Constructor Detail

      • Converter

        public Converter()
    • Method Detail

      • convert

        public Document convert​(Document image,
                                Stream outStream,
                                Profile profile)
                         throws java.io.IOException,
                                GenericException,
                                LicenseException,
                                CorruptException,
                                ProcessingException

        Convert an image to a PDF document

        Parameters:
        image - The input image document containing one or more pages.
        outStream - The stream to which the PDF is written.
        profile -

        The profile defines the properties of the output document and how the images are placed onto the pages.

        For details, see profiles.Profile.

        Returns:

        The resulting output PDF which can be used as a new input for further processing.

        Note that, this object must be disposed before the output stream object (method argument outStream).

        Throws:
        LicenseException - The license is invalid.
        java.io.IOException - Writing to the output PDF failed.
        CorruptException - The input image document is corrupt and cannot be read.
        GenericException - An unexpected failure occurred.
        ProcessingException - The conversion failed.
        java.lang.IllegalArgumentException - The profile specifies invalid options.
        java.lang.IllegalArgumentException - The outOptions specifies document encryption and the profile PDF/A conformance, which is not allowed.
        java.lang.IllegalArgumentException - if image is null
        java.lang.IllegalArgumentException - if outStream is null
        java.lang.IllegalArgumentException - if profile is null
      • convert

        public Document convert​(Document image,
                                Stream outStream,
                                Profile profile,
                                OutputOptions outOptions)
                         throws java.io.IOException,
                                GenericException,
                                LicenseException,
                                CorruptException,
                                ProcessingException

        Convert an image to a PDF document

        Parameters:
        image - The input image document containing one or more pages.
        outStream - The stream to which the PDF is written.
        profile -

        The profile defines the properties of the output document and how the images are placed onto the pages.

        For details, see profiles.Profile.

        outOptions - The PDF output options, e.g. to encrypt the output document.
        Returns:

        The resulting output PDF which can be used as a new input for further processing.

        Note that, this object must be disposed before the output stream object (method argument outStream).

        Throws:
        LicenseException - The license is invalid.
        java.io.IOException - Writing to the output PDF failed.
        CorruptException - The input image document is corrupt and cannot be read.
        GenericException - An unexpected failure occurred.
        ProcessingException - The conversion failed.
        java.lang.IllegalArgumentException - The profile specifies invalid options.
        java.lang.IllegalArgumentException - The outOptions specifies document encryption and the profile PDF/A conformance, which is not allowed.
        java.lang.IllegalArgumentException - if image is null
        java.lang.IllegalArgumentException - if outStream is null
        java.lang.IllegalArgumentException - if profile is null
      • convertMultiple

        public Document convertMultiple​(DocumentList images,
                                        Stream outStream,
                                        Profile profile)
                                 throws java.io.IOException,
                                        GenericException,
                                        LicenseException,
                                        CorruptException,
                                        ProcessingException

        Convert a list of images to a PDF document

        Parameters:
        images - The input image document list, each image containing one or more pages.
        outStream - The stream to which the PDF is written.
        profile -

        The profile defines the properties of the output document and how the images are placed onto the pages.

        For details, see profiles.Profile.

        Returns:

        The resulting output PDF which can be used as a new input for further processing.

        Note that, this object must be disposed before the output stream object (method argument outStream).

        Throws:
        LicenseException - The license is invalid.
        java.io.IOException - Writing to the output PDF failed.
        CorruptException - An input image document is corrupt and cannot be read.
        GenericException - An unexpected failure occurred.
        ProcessingException - The conversion failed.
        java.lang.IllegalArgumentException - The profile specifies invalid options.
        java.lang.IllegalArgumentException - The outOptions specifies document encryption and the profile PDF/A conformance, which is not allowed.
        java.lang.IllegalArgumentException - if images is null
        java.lang.IllegalArgumentException - if outStream is null
        java.lang.IllegalArgumentException - if profile is null
      • convertMultiple

        public Document convertMultiple​(DocumentList images,
                                        Stream outStream,
                                        Profile profile,
                                        OutputOptions outOptions)
                                 throws java.io.IOException,
                                        GenericException,
                                        LicenseException,
                                        CorruptException,
                                        ProcessingException

        Convert a list of images to a PDF document

        Parameters:
        images - The input image document list, each image containing one or more pages.
        outStream - The stream to which the PDF is written.
        profile -

        The profile defines the properties of the output document and how the images are placed onto the pages.

        For details, see profiles.Profile.

        outOptions - The PDF output options, e.g. to encrypt the output document.
        Returns:

        The resulting output PDF which can be used as a new input for further processing.

        Note that, this object must be disposed before the output stream object (method argument outStream).

        Throws:
        LicenseException - The license is invalid.
        java.io.IOException - Writing to the output PDF failed.
        CorruptException - An input image document is corrupt and cannot be read.
        GenericException - An unexpected failure occurred.
        ProcessingException - The conversion failed.
        java.lang.IllegalArgumentException - The profile specifies invalid options.
        java.lang.IllegalArgumentException - The outOptions specifies document encryption and the profile PDF/A conformance, which is not allowed.
        java.lang.IllegalArgumentException - if images is null
        java.lang.IllegalArgumentException - if outStream is null
        java.lang.IllegalArgumentException - if profile is null