Class Converter
The class to convert one or more images to a PDF document
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionConvert an image to a PDF documentconvert(Document image, Stream outStream, Profile profile, OutputOptions outOptions) Convert an image to a PDF documentconvertMultiple(DocumentList images, Stream outStream, Profile profile) Convert a list of images to a PDF documentconvertMultiple(DocumentList images, Stream outStream, Profile profile, OutputOptions outOptions) Convert a list of images to a PDF documentMethods inherited from class com.pdftools.internal.NativeObject
equals, hashCode
-
Constructor Details
-
Converter
public Converter()
-
-
Method Details
-
convert
public Document convert(Document image, Stream outStream, Profile profile) throws 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.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.IllegalArgumentException- Theprofilespecifies invalid options.IllegalArgumentException- TheoutOptionsspecifies document encryption and theprofilePDF/A conformance, which is not allowed.IllegalArgumentException- ifimageisnullIllegalArgumentException- ifoutStreamisnullIllegalArgumentException- ifprofileisnull
-
convert
public Document convert(Document image, Stream outStream, Profile profile, OutputOptions outOptions) throws 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.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.IllegalArgumentException- Theprofilespecifies invalid options.IllegalArgumentException- TheoutOptionsspecifies document encryption and theprofilePDF/A conformance, which is not allowed.IllegalArgumentException- ifimageisnullIllegalArgumentException- ifoutStreamisnullIllegalArgumentException- ifprofileisnull
-
convertMultiple
public Document convertMultiple(DocumentList images, Stream outStream, Profile profile) throws 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.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.IllegalArgumentException- Theprofilespecifies invalid options.IllegalArgumentException- TheoutOptionsspecifies document encryption and theprofilePDF/A conformance, which is not allowed.IllegalArgumentException- ifimagesisnullIllegalArgumentException- ifoutStreamisnullIllegalArgumentException- ifprofileisnull
-
convertMultiple
public Document convertMultiple(DocumentList images, Stream outStream, Profile profile, OutputOptions outOptions) throws 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.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.IllegalArgumentException- Theprofilespecifies invalid options.IllegalArgumentException- TheoutOptionsspecifies document encryption and theprofilePDF/A conformance, which is not allowed.IllegalArgumentException- ifimagesisnullIllegalArgumentException- ifoutStreamisnullIllegalArgumentException- ifprofileisnull
-