Skip to main content

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.

PDF Optimizer documentation and code samples

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.

Pdftools SDK optimization quick start

Download a full sample of PDF optimization using the Pdftools SDK in C#, Java, C, and Python.

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 profilePdftools SDK optimization profile
eOptimizationProfileWebWeb
eOptimizationProfileArchiveArchive
eOptimizationProfilePrintPrint
eOptimizationProfileDefault or eOptimizationProfileMaxMinimalFileSize
eOptimizationProfileMRCMrc
Not implemented
  1. 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 profileImage color spacePDF Optimizer compression type
WebBitonaleComprAttemptSource or eComprAttemptGroup4
WebIndexedeComprAttemptSource or eComprAttemptFlate
PrintBitonaleComprAttemptSource or eComprAttemptGroup4
PrintIndexedeComprAttemptSource or eComprAttemptFlate
ArchiveBitonaleComprAttemptSource or eComprAttemptGroup4 or eComprAttemptJBIG2
ArchiveIndexedeComprAttemptSource or eComprAttemptFlate
MinimalFileSizeBitonaleComprAttemptSource or eComprAttemptGroup4 or eComprAttemptJBIG2
MinimalFileSizeIndexedeComprAttemptSource 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 profileCompression algorithm selectionPDF Optimizer compression type
WebPreserveQualityeComprAttemptSource
WebSpeedeComprAttemptJPEG or eComprAttemptSource
WebBalancedeComprAttemptJPEG or eComprAttemptSource
ArchivePreserveQualityeComprAttemptJPEG2000 or eComprAttemptFlate
ArchiveSpeedeComprAttemptJPEG or eComprAttemptSource
ArchiveBalancedeComprAttemptJPEG or eComprAttemptJPEG2000 or eComprAttemptSource
PrintPreserveQualityeComprAttemptNone
PrintSpeedeComprAttemptJPEG or eComprAttemptSource
PrintBalancedeComprAttemptJPEG or eComprAttemptJPEG2000 or eComprAttemptSource
MinimalFileSizePreserveQualityeComprAttemptSource
MinimalFileSizeSpeedeComprAttemptJPEG or eComprAttemptSource
MinimalFileSizeBalancedeComprAttemptJPEG 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 propertyPdftools SDK property
ColorResolutionDPIResolutionDPI
ColorThresholdDPIThresholdDPI
MonochromeResolutionDPIResolutionDPI
MonochromeThresholdDPIThresholdDPI
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 typePdftools SDK RemovalOption
eStripAnnotsAnnotations
eStripFormsFormFields
eStripLinksLinks
eStripAlternatesRemoveAlternateImages
eStripMetadataRemoveMetadata
eStripOutputIntentsRemoveOutputIntents
eStripPieceInfoRemovePieceInfo
eStripSpiderTrue for all profiles except Archive
eStripStructTreeRemoveStructureTree
eStripThumbRemoveThumbnails

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 flagDescriptionPdftools SDK flag
-cSet the color conversionNot supported
-cffCompress Type1 fonts (convert to CFF)Always true
-cmsSet the color management engineAlways none
-dmrResolution for monochrome imagesSee -dr
-dmtThreshold for monochrome imagesSee -dt
-dcrResolution for color imagesSee -dr
-dctThreshold for color imagesSee -dt
-dbrResolution for bitonal imagesNot supported
-dbtThreshold for bitonal imagesNot supported
-drResolution in DPI-dr
-dtThreshold in DPI-dt
-fbCompression types for bitonal imagesPreselected based on optimization profile
-fcCompression types for color and grayscale images-as
-ffForce re-compressionNot supported
-fiCompression types for indexed (paletted) imagesPreselected based on optimization profile
-fnFile nameInput file is inferred from command syntax
-ftForce compression typesNot supported
-fvMinimum PDF versionNot supported
-hDithering mode for bitonal imagesNot supported
-idSet value in the document information dictionary-t <title>
-a <author>
-s <subject>
-k <keyword1,keyword2> etc.
-c <creator>
-cd <creation date>
-md <modification date>
-lfList fontsNot supported
-liList imagesNot supported
-lkSet license key-lk
-mMerge embedded font programs-nmf to disable
-mlCompression type for MRC layers-as
-mlqImage quality for MRC layers-lq
-mlrResolution in DPI for MRC layers-lr
-mmCompression type for the MRC maskAlways eComprAttemptJBIG2
-mpCompression type for MRC cutout picturesNot supported
-oOwner password-opw <perms>
-ocClip imagesAlways true
-odOptimize resourcesAlways true
-olLinearize onlyNot supported
-orRemove redundant objectsAlways true
-owOptimize for the webUse optimize-web command
-owaOptimize for the Web automaticallyUse optimize-web command
-pPermission flagsSee <perms> parameter of -opw
-prSet an optimization profileProfile is inferred from command
-pwRead an encrypted PDF file-pw
-qCompression quality-q
-rcReduce image color complexityAlways true
-riRemove imagesAlways false
-rfRemove embedded font programNot supported
-rsRemove embedded standard fonts-rsf
-sSubset fontsAlways true
-saStrip article threads-kat (keep article threads)
-sfFlatten and strip form fields and annotations-csa and -csf
-sffFlatten and strip form fields-csf
-sflFlatten and strip link annotations-csa
-sfaFlatten and strip other annotations-csa
-sfsFlatten appearances of signature fields-csa
-siaFlatten and strip invisible annotations-csa
-siStrip alternate images-rai
-smStrip metadata-km (keep metadata)
-soStrip output intents-roi
-spStrip page piece info (private application data)-kpi (keep piece info)
-ssStrip document tree structure-kst (keep document tree structure)
-stStrip thumbnails-kt (keep thumbnails)
-swStrip spider (web capture) infoAlways true
-uUser password-upw
-vVerbose mode-verbose
-xfExtract fontsNot supported
-xiExtract imagesNot supported