new Optimizer()
The Optimizer class provides functionality for optimizing/shrinking
output PDF files.
'pdftron.PDF.Optimizer' is an optional PDFNet Add-On utility class that can be
used to optimize PDF documents by reducing the file size, removing redundant
information, and compressing data streams using the latest in image compression
technology. PDF Optimizer can compress and shrink PDF file size with the
following operations:
- Remove duplicated fonts, images, ICC profiles, and any other data stream.
- Optionally convert high-quality or print-ready PDF files to small, efficient and web-ready PDF.
- Optionally down-sample large images to a given resolution.
- Optionally compress or recompress PDF images using JBIG2 and JPEG2000 compression formats.
- Compress uncompressed streams and remove unused PDF objects.
Note: 'Optimizer' is available as a separately licensable add-on to PDFNet
core license.
Note: See 'pdftron.PDF.Flattener' for alternate approach to optimize PDFs for fast
viewing on mobile devices and the Web.
Classes
Methods
-
<static> createImageSettings()
-
Method to create an ImageSettings object
Returns:
A promise that resolves to a PDFNet.Optimizer.ImageSettings.- Type
- Promise.<Core.PDFNet.Optimizer.ImageSettings>
-
<static> createMonoImageSettings()
-
Method to create an MonoImageSettings object
Returns:
A promise that resolves to a PDFNet.Optimizer.MonoImageSettings.- Type
- Promise.<Core.PDFNet.Optimizer.MonoImageSettings>
-
<static> createOptimizerSettings()
-
Method to create an OptimizerSettings object
Returns:
A promise that resolves to a PDFNet.Optimizer.OptimizerSettings.- Type
- Promise.<Core.PDFNet.Optimizer.OptimizerSettings>
-
<static> createTextSettings()
-
Method to create an TextSettings object
Returns:
A promise that resolves to a PDFNet.Optimizer.TextSettings.- Type
- Promise.<Core.PDFNet.Optimizer.TextSettings>
-
<static> optimize(doc [, optimizerSettings])
-
Optimize the given document using the optimizers settings
Parameters:
Name Type Argument Description doc
Core.PDFNet.PDFDoc | Core.PDFNet.SDFDoc | Core.PDFNet.FDFDoc the document to optimize optimizerSettings
object <optional>
the settings for the optimizer Returns:
- Type
- Promise.<void>