User Interfaces

The Library uses the PDDocOptimize interface element to optimize PDF documents:

PDDocOptimize(PDDoc doc, ASPathName newDocument, ASFileSys newFileSys, PDFOptimizationParams params

The interface opens a PDF document and saves an optimized copy of this document in a new location, applying the parameters specified by the user. When the process is complete the original PDF document should be closed without being saved.

The parameters describe what optimizations should be applied to the PDF document. These parameters can only be created by a call to the interface element:


The parameters are similar to the default set of parameters provided with the PDF optimization feature offered with Adobe Acrobat.

You can issue a call to PDDocOptimizeSetOption to turn specific options on or off:

PDDocOptimizeSetOption (PDFOptimizationParams parameters, ASBool Option)

To set values for image recompression, issue a call to PDDocOptimizeSetImageRecompress:

PDDocOptimizeSetImageRecompress (PDFOptimizationParams Parameters, PDFOptimizerCompressImageType imageType, ASInt16 recompressIfAbove, ASInt16 recompressTo, PDFOptimizerCompressionType compressType, PDFOptimizationCompressQuality compressQuality)

You can also call a pair of interfaces to verify the settings for the optimization parameters, PDDocOptimizeGetOption and PDDocOptimizeGetImageRecompress:

ASBool PDDocOptimizeGetOption (PDFOptimizationParams Parameters, PDFOptimizerOption option)

PDDocOptimizeGetImageRecompress (PDFOptimizationParams Parameters, PDFOptimizerCompressImageType imageType, ASInt16 *recompressIfAbove, ASInt16 *recompressTo, PDFOptimizerCompressionType *compressType, PDFOptimizationCompressQuality *compressQuality)

These interfaces are fully defined in the header files:

  • DLExtrasProcs.h
  • DLExtrasCalls.h, for the Host Function Table (HFT)
  • DLExtrasExpT.h