Class: Optimizer

PDFNet. Optimizer


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.

Methods


<static> imageSettingsInit()

create an ImageSettings object with default options

Returns:

A promise that resolves to an object of type: "optimizerimagesettings"

Type
PDFNet.OptimizerImageSettings

<static> monoImageSettingsInit()

create an MonoImageSettings object with default options

Returns:

A promise that resolves to an object of type: "optimizermonoimagesettings"

Type
PDFNet.OptimizerMonoImageSettings

<static> optimize(doc, color_image_settings, grayscale_image_settings, mono_image_settings, text_settings, remove_custom)

Parameters:
Name Type Description
doc PDFNet.PDFDoc
color_image_settings PDFNet.OptimizerImageSettings
grayscale_image_settings PDFNet.OptimizerImageSettings
mono_image_settings PDFNet.OptimizerMonoImageSettings
text_settings PDFNet.OptimizerTextSettings
remove_custom boolean

<static> textSettingsInit()

create an TextSettings object with default options

Returns:

A promise that resolves to an object of type: "optimizertextsettings"

Type
PDFNet.OptimizerTextSettings