Package com.pdftools.optimization
Class Optimizer
java.lang.Object
com.pdftools.internal.NativeBase
com.pdftools.internal.NativeObject
com.pdftools.optimization.Optimizer
The class to optimize PDF documents
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionoptimizeDocument(Document inDoc, Stream outStream, Profile profile) Optimize the PDF documentoptimizeDocument(Document inDoc, Stream outStream, Profile profile, OutputOptions outOptions) Optimize the PDF documentMethods inherited from class com.pdftools.internal.NativeObject
equals, hashCode
-
Constructor Details
-
Optimizer
public Optimizer()
-
-
Method Details
-
optimizeDocument
public Document optimizeDocument(Document inDoc, Stream outStream, Profile profile) throws IOException, GenericException, LicenseException, ProcessingException Optimize the PDF document
- Parameters:
inDoc- The input PDF documentoutStream- The stream to which the output PDF is writtenprofile- The profile defining the optimization parameters.- Returns:
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).- Throws:
LicenseException- The license check has failed.IllegalArgumentException- An invalid encryption was specified inoutOptions.ProcessingException- The processing has failed.IOException- Writing to the output PDF has failed.GenericException- A generic error occurred.IllegalArgumentException- ifinDocisnullIllegalArgumentException- ifoutStreamisnullIllegalArgumentException- ifprofileisnull
-
optimizeDocument
public Document optimizeDocument(Document inDoc, Stream outStream, Profile profile, OutputOptions outOptions) throws IOException, GenericException, LicenseException, ProcessingException Optimize the PDF document
- Parameters:
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.- Returns:
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).- Throws:
LicenseException- The license check has failed.IllegalArgumentException- An invalid encryption was specified inoutOptions.ProcessingException- The processing has failed.IOException- Writing to the output PDF has failed.GenericException- A generic error occurred.IllegalArgumentException- ifinDocisnullIllegalArgumentException- ifoutStreamisnullIllegalArgumentException- ifprofileisnull
-