PDF Optimizer documentation
The PDF Optimizer has been replaced by the Pdftools SDK, providing improved quality, optimized compression, and reliability improvements. On this page, you can learn how to migrate from the PDF Optimizer to the Pdftools SDK.
The PDF Optimizer is no longer available to new customers. However, you can still view the API developer, Shell tool developer, and Service developer guides.
You can also explore the code samples for examples of how to use the PDF Optimizer API.
Migrate from the PDF Optimizer to the Pdftools SDK
Migrate to the Pdftools SDK to use a streamlined interface for selecting and applying the best possible compression and optimization parameters.
Optimization profiles
The PDF Optimizer provides pre-configured optimization profiles suitable for specific use cases. The same profiles are also available in the Pdftools SDK. You can map optimization profiles from the PDF Optimizer to the Pdftools SDK using the following table:
PDF Optimizer optimization profile | Pdftools SDK optimization profile |
---|---|
eOptimizationProfileWeb | Web |
eOptimizationProfileArchive | Archive |
eOptimizationProfilePrint | |
eOptimizationProfileDefault or eOptimizationProfileMax | MinimalFileSize |
eOptimizationProfileMRC | Mrc |
- The Pdftools SDK does not yet support linearization.
Image compression settings
The Pdftools SDK selects the best image compression settings based on your chosen optimization profile, but you can still adjust the settings to suit your specific needs.
Compression algorithm selection
The PDF Optimizer lets you set image compression types with bitonal, continuous, and indexed color spaces. With the Pdftools SDK, you can use the optimization profile and compression algorithm selection to determine the image compression type.
For images with bitonal and indexed color spaces, you can map the optimization profile and image color space to the equivalent PDF Optimizer compression types using the following table:
Optimization profile | Image color space | PDF Optimizer compression type |
---|---|---|
Web | Bitonal | eComprAttemptSource or eComprAttemptGroup4 |
Web | Indexed | eComprAttemptSource or eComprAttemptFlate |
Bitonal | eComprAttemptSource or eComprAttemptGroup4 | |
Indexed | eComprAttemptSource or eComprAttemptFlate | |
Archive | Bitonal | eComprAttemptSource or eComprAttemptGroup4 or eComprAttemptJBIG2 |
Archive | Indexed | eComprAttemptSource or eComprAttemptFlate |
MinimalFileSize | Bitonal | eComprAttemptSource or eComprAttemptGroup4 or eComprAttemptJBIG2 |
MinimalFileSize | Indexed | eComprAttemptSource or eComprAttemptFlate or eComprAttemptLZW |
For images with continuous color spaces, you can map the Pdftools SDK optimization profile and compression algorithm selection to the equivalent PDF Optimizer compression types using the following table:
Optimization profile | Compression algorithm selection | PDF Optimizer compression type |
---|---|---|
Web | PreserveQuality | eComprAttemptSource |
Web | Speed | eComprAttemptJPEG or eComprAttemptSource |
Web | Balanced | eComprAttemptJPEG or eComprAttemptSource |
Archive | PreserveQuality | eComprAttemptJPEG2000 or eComprAttemptFlate |
Archive | Speed | eComprAttemptJPEG or eComprAttemptSource |
Archive | Balanced | eComprAttemptJPEG or eComprAttemptJPEG2000 or eComprAttemptSource |
PreserveQuality | eComprAttemptNone | |
Speed | eComprAttemptJPEG or eComprAttemptSource | |
Balanced | eComprAttemptJPEG or eComprAttemptJPEG2000 or eComprAttemptSource | |
MinimalFileSize | PreserveQuality | eComprAttemptSource |
MinimalFileSize | Speed | eComprAttemptJPEG or eComprAttemptSource |
MinimalFileSize | Balanced | eComprAttemptJPEG or eComprAttemptJPEG2000 or eComprAttemptSource |
Image quality for lossy compression
The PDF Optimizer ImageQuality
property is equivalent to the Pdftools SDK CompressionQuality property.
Images with bitonal and indexed color spaces are not affected by the ImageQuality
property. The Pdftools SDK always uses lossless compression for images with bitonal and indexed color spaces.
Downsampling
The PDF Optimizer allows to independently set the target and threshold DPI for bitonal, monochrome, and color images. The Pdftools SDK lets you set the target DPI for monochrome and color images. Bitonal images are not resampled to avoid adding significant image artifacts during optimization.
In the Pdftools SDK, the default threshold for resampling an image always equals 1.4 times the ResolutionDPI
property. You can override the default value by using the ThresholdDPI
property.
PDF Optimizer property | Pdftools SDK property |
---|---|
ColorResolutionDPI | ResolutionDPI |
ColorThresholdDPI | ThresholdDPI |
MonochromeResolutionDPI | ResolutionDPI |
MonochromeThresholdDPI | ThresholdDPI |
BitonalResolutionDPI | -1.0 (do not resample) |
BitonalThresholdDPI | -1.0 (do not resample) |
Clipping images
There is no equivalent to the PDF Optimizer ClipImages
property. The Pdftools SDK clips images when possible.
Removing images
There is no equivalent to the PDF Optimizer RemoveImages
property. Use the Toolbox add-on of the Pdftools SDK to remove and redact content from a PDF file before optimizing.
Reducing color complexity
The PDF Optimizer ReduceColorComplexity
property is equivalent to the Pdftools SDK ReduceColorComplexity property.
Dithering bitonal images
There is no equivalent to the PDF Optimizer DitheringMode
property. The Pdftools SDK doesn't downsample or dither bitonal images.
Merge and remove content
The Pdftools SDK selects the best content removal settings based on your chosen optimization profile, but you can still adjust the settings to suit your specific needs.
Optimize resources
There is no equivalent to the PDF Optimizer OptimizeResources
property. The Pdftools SDK optimizes resources when possible.
Merge, compress, and remove fonts
- There is no equivalent to the PDF Optimizer
SubsetFonts
property. The Pdftools SDK subsets fonts when possible. - There is no equivalent to the PDF Optimizer
CompactFont
property. The Pdftools SDK compacts fonts when possible. - The PDF Optimizer
MergeEmbeddedFonts
property is equivalent to the Pdftools SDK FontOptions.Merge property. - The PDF Optimizer
RemoveStandardFonts
property is equivalent to the Pdftools SDK FontOptions.RemoveStandardFonts property.
Flatten and remove content
The PDF Optimizer and the Pdftools SDK have equivalent functionality for flatting and removing content from a PDF file during optimization. The Strip
property from the PDF Optimizer is replaced by the RemovalOptions class of the Pdftools SDK using the following table:
PDF Optimizer strip type | Pdftools SDK RemovalOption |
---|---|
eStripAnnots | Annotations |
eStripForms | FormFields |
eStripLinks | Links |
eStripAlternates | RemoveAlternateImages |
eStripMetadata | RemoveMetadata |
eStripOutputIntents | RemoveOutputIntents |
eStripPieceInfo | RemovePieceInfo |
eStripSpider | True for all profiles except Archive |
eStripStructTree | RemoveStructureTree |
eStripThumb | RemoveThumbnails |
The PDF Optimizer property FlattenSignatureFields
is replaced by the Pdftools SDK RemovalOptions.RemoveSignatureAppearances property.
Encryption
Refer to the Pdftools SDK documentation to encrypt and decrypt a PDF file when using the optimization features of the Pdftools SDK.
Extract image data and font files
There is no equivalent to the PDF Optimizer ListFonts
, ExtractFonts
, ListImages
, or ExtractImages
in the Pdftools SDK. Instead, use the Toolbox add-on of the Pdftools SDK to extract information from a PDF file before optimizing.
Set document metadata and information
Refer to the Toolbox add-on documentation to manage metadata in a PDF file before or after optimizing.
Work with memory streams
In the PDF Optimizer, special functions like OpenMem
, SaveInMemory
, and GetPdf
store and retrieve file data in memory. In the Pdftools SDK all methods such as OptimizeDocument that input or output file data use Stream
objects. The Stream
object can be either a file stream or a memory stream, so you can easily choose whether to store and retrieve file data in memory or on the file system.
Migrate from the PDF Optimizer shell tool to the Pdftools SDK Shell Tool
Unlike Pdftools' previous products which required a different shell tool for each function, the Pdftools SDK provides a single shell tool that includes all SDK functions, including optimization.
The PDF Optimizer pdfoptimize
shell tool is replaced by the Pdftools SDK Shell Tool. See Pdftools SDK Shell Tool getting started guide for more information.
To access general help for the Pdftools SDK Shell Tool, run:
pdf help
Use profiles
The Pdftools SDK Shell Tool uses optimization profiles to preset many optimization flags.
To access help for specific optimization profiles, run one of the following commands:
pdf help optimize-web
pdf help optimize-archive
pdf help optimize-print
pdf help optimize-minimal
pdf help optimize-mrc
Pdftools SDK Shell Tool optimization flags
You can map flags from the PDF Optimizer to the Pdftools SDK using the following table:
PDF Optimizer flag | Description | Pdftools SDK flag |
---|---|---|
-c | Set the color conversion | Not supported |
-cff | Compress Type1 fonts (convert to CFF) | Always true |
-cms | Set the color management engine | Always none |
-dmr | Resolution for monochrome images | See -dr |
-dmt | Threshold for monochrome images | See -dt |
-dcr | Resolution for color images | See -dr |
-dct | Threshold for color images | See -dt |
-dbr | Resolution for bitonal images | Not supported |
-dbt | Threshold for bitonal images | Not supported |
-dr | Resolution in DPI | -dr |
-dt | Threshold in DPI | -dt |
-fb | Compression types for bitonal images | Preselected based on optimization profile |
-fc | Compression types for color and grayscale images | -as |
-ff | Force re-compression | Not supported |
-fi | Compression types for indexed (paletted) images | Preselected based on optimization profile |
-fn | File name | Input file is inferred from command syntax |
-ft | Force compression types | Not supported |
-fv | Minimum PDF version | Not supported |
-h | Dithering mode for bitonal images | Not supported |
-id | Set value in the document information dictionary | -t <title> |
-a <author> | ||
-s <subject> | ||
-k <keyword1,keyword2> etc. | ||
-c <creator> | ||
-cd <creation date> | ||
-md <modification date> | ||
-lf | List fonts | Not supported |
-li | List images | Not supported |
-lk | Set license key | -lk |
-m | Merge embedded font programs | -nmf to disable |
-ml | Compression type for MRC layers | -as |
-mlq | Image quality for MRC layers | -lq |
-mlr | Resolution in DPI for MRC layers | -lr |
-mm | Compression type for the MRC mask | Always eComprAttemptJBIG2 |
-mp | Compression type for MRC cutout pictures | Not supported |
-o | Owner password | -opw <perms> |
-oc | Clip images | Always true |
-od | Optimize resources | Always true |
-ol | Linearize only | Not supported |
-or | Remove redundant objects | Always true |
-ow | Optimize for the web | Use optimize-web command |
-owa | Optimize for the Web automatically | Use optimize-web command |
-p | Permission flags | See <perms> parameter of -opw |
-pr | Set an optimization profile | Profile is inferred from command |
-pw | Read an encrypted PDF file | -pw |
-q | Compression quality | -q |
-rc | Reduce image color complexity | Always true |
-ri | Remove images | Always false |
-rf | Remove embedded font program | Not supported |
-rs | Remove embedded standard fonts | -rsf |
-s | Subset fonts | Always true |
-sa | Strip article threads | -kat (keep article threads) |
-sf | Flatten and strip form fields and annotations | -csa and -csf |
-sff | Flatten and strip form fields | -csf |
-sfl | Flatten and strip link annotations | -csa |
-sfa | Flatten and strip other annotations | -csa |
-sfs | Flatten appearances of signature fields | -csa |
-sia | Flatten and strip invisible annotations | -csa |
-si | Strip alternate images | -rai |
-sm | Strip metadata | -km (keep metadata) |
-so | Strip output intents | -roi |
-sp | Strip page piece info (private application data) | -kpi (keep piece info) |
-ss | Strip document tree structure | -kst (keep document tree structure) |
-st | Strip thumbnails | -kt (keep thumbnails) |
-sw | Strip spider (web capture) info | Always true |
-u | User password | -upw |
-v | Verbose mode | -verbose |
-xf | Extract fonts | Not supported |
-xi | Extract images | Not supported |