Class Converter
- java.lang.Object
-
- com.pdftools.internal.NativeBase
-
- com.pdftools.internal.NativeObject
-
- com.pdftools.image2pdf.Converter
-
public class Converter extends NativeObject
The class to convert one or more images to a PDF document
-
-
Constructor Summary
Constructors Constructor Description Converter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Document
convert(Document image, Stream outStream, Profile profile)
Convert an image to a PDF documentDocument
convert(Document image, Stream outStream, Profile profile, OutputOptions outOptions)
Convert an image to a PDF documentDocument
convertMultiple(DocumentList images, Stream outStream, Profile profile)
Convert a list of images to a PDF documentDocument
convertMultiple(DocumentList images, Stream outStream, Profile profile, OutputOptions outOptions)
Convert a list of images to a PDF document-
Methods inherited from class com.pdftools.internal.NativeObject
equals, hashCode
-
-
-
-
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
- Theprofile
specifies invalid options.java.lang.IllegalArgumentException
- TheoutOptions
specifies document encryption and theprofile
PDF/A conformance, which is not allowed.java.lang.IllegalArgumentException
- ifimage
isnull
java.lang.IllegalArgumentException
- ifoutStream
isnull
java.lang.IllegalArgumentException
- ifprofile
isnull
-
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
- Theprofile
specifies invalid options.java.lang.IllegalArgumentException
- TheoutOptions
specifies document encryption and theprofile
PDF/A conformance, which is not allowed.java.lang.IllegalArgumentException
- ifimage
isnull
java.lang.IllegalArgumentException
- ifoutStream
isnull
java.lang.IllegalArgumentException
- ifprofile
isnull
-
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
- Theprofile
specifies invalid options.java.lang.IllegalArgumentException
- TheoutOptions
specifies document encryption and theprofile
PDF/A conformance, which is not allowed.java.lang.IllegalArgumentException
- ifimages
isnull
java.lang.IllegalArgumentException
- ifoutStream
isnull
java.lang.IllegalArgumentException
- ifprofile
isnull
-
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
- Theprofile
specifies invalid options.java.lang.IllegalArgumentException
- TheoutOptions
specifies document encryption and theprofile
PDF/A conformance, which is not allowed.java.lang.IllegalArgumentException
- ifimages
isnull
java.lang.IllegalArgumentException
- ifoutStream
isnull
java.lang.IllegalArgumentException
- ifprofile
isnull
-
-