
Adobe Acrobat SDK
Working with Acrobat Extended APIs
Developing Plug-ins and Applications
PDF Optimizer API 244
PDF Optimizer API
PDF Optimizer API is part of the AV layer and is exported using the AcroView HFT. You use this API to work
with the PDF Optimizer tool, which optimizes an active PDF document and then saves it using the
PDDocSaveWithParams
method to a specified location. The PDF Optimizer API is available with the
Professional version of Acrobat, but not with the Standard version or with Adobe Reader.
Using this API, you can reduce the size of bulky PDF files and run Distiller optimizations on PDF files
without having to print them. Avoiding the print route enables you to retain bookmarks, tags, links, and so
on. You can also make PDF files compatible with specific versions of Acrobat.
You can invoke the
AVDocSaveOptimized
method to run the PDF Optimizer tool on a specified PDF
document. An optimized document is created using the settings specified in the
PDFOptParams
structure. The optimized document is saved to disk at the location specified in the parameter's structure. If
the operation is successful, the active document is closed and the optimized document is opened for
viewing. If the operation fails, the active document remains open.
The
AVDoc
object passed to the proc should not be dirty. PDF Optimizer is unavailable in external
windows like those of a web browser, so the
AVDoc
object should not be from a document open in an
external window. The document should not be of a version greater than the default PDF version of the
Acrobat application.
When you invoke the
AVDocSaveOptimized
method, pass the following arguments:
●
An
AVDoc
object that represents the PDF document to optimize.
●
An instance of a
PDFOptParams
data structure. For information about this data structure, see the
Acrobat and PDF Library API Reference
.