public class Optimizer extends NativeObject
Constructor | Description |
---|---|
Optimizer() |
Modifier and Type | Method | Description |
---|---|---|
Document |
optimizeDocument(Document inDoc,
Stream outStream,
Profile profile) |
Optimize the PDF document
|
Document |
optimizeDocument(Document inDoc,
Stream outStream,
Profile profile,
OutputOptions outOptions) |
Optimize the PDF document
|
equals, hashCode
public Document optimizeDocument(Document inDoc, Stream outStream, Profile profile) throws java.io.IOException, GenericException, LicenseException, ProcessingException
inDoc
- The input PDF documentoutStream
- The stream to which the output PDF is writtenprofile
- The profile defining the optimization parameters.The optimized result 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 check has failed.java.lang.IllegalArgumentException
- An invalid encryption was specified in outOptions
.ProcessingException
- The processing has failed.java.io.IOException
- Writing to the output PDF has failed.GenericException
- A generic error occurred.java.lang.IllegalArgumentException
- if inDoc
is null
java.lang.IllegalArgumentException
- if outStream
is null
java.lang.IllegalArgumentException
- if profile
is null
public Document optimizeDocument(Document inDoc, Stream outStream, Profile profile, OutputOptions outOptions) throws java.io.IOException, GenericException, LicenseException, ProcessingException
inDoc
- The input PDF documentoutStream
- The stream to which the output PDF is writtenprofile
- The profile defining the optimization parameters.outOptions
- The PDF output options, e.g. to encrypt the output document.The optimized result 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 check has failed.java.lang.IllegalArgumentException
- An invalid encryption was specified in outOptions
.ProcessingException
- The processing has failed.java.io.IOException
- Writing to the output PDF has failed.GenericException
- A generic error occurred.java.lang.IllegalArgumentException
- if inDoc
is null
java.lang.IllegalArgumentException
- if outStream
is null
java.lang.IllegalArgumentException
- if profile
is null