public class Converter extends NativeObject
Constructor | Description |
---|---|
Converter() |
Modifier and Type | Method | Description |
---|---|---|
Document |
convert(Document image,
Stream outStream,
Profile profile) |
Convert an image to a PDF document
|
Document |
convert(Document image,
Stream outStream,
Profile profile,
OutputOptions outOptions) |
Convert an image to a PDF document
|
equals, hashCode
public Document convert(Document image, Stream outStream, Profile profile) throws java.io.IOException, GenericException, LicenseException, CorruptException, ProcessingException
image
- The input image document containing one or more pages.outStream
- The stream to which the PDF is written to.profile
- The profile defines the properties of the output document and how the images are placed onto the pages.
For details, see profiles.Profile
.
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
).
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
public Document convert(Document image, Stream outStream, Profile profile, OutputOptions outOptions) throws java.io.IOException, GenericException, LicenseException, CorruptException, ProcessingException
image
- The input image document containing one or more pages.outStream
- The stream to which the PDF is written to.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.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
).
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