Foxit PDF SDK
com.foxit.sdk.addon.optimization.Optimizer Class Reference
Inheritance diagram for com.foxit.sdk.addon.optimization.Optimizer:
com.foxit.sdk.common.Base

Static Public Member Functions

static Progressive optimize (PDFDoc doc, OptimizerSettings settings, PauseCallback pause) throws com.foxit.sdk.PDFException
 Optimize the given PDF document with specified optimizers settings.
More...
 

Detailed Description

This class can be used to optimize PDF file to reduce file size. Before using this class to do optimization, please ensure Foxti PDF SDK has been initialized successfully by function common.Library.initialize with a key including "Optimizer" module.

See also
com.foxit.sdk.common.Library

Member Function Documentation

◆ optimize()

static Progressive com.foxit.sdk.addon.optimization.Optimizer.optimize ( PDFDoc  doc,
OptimizerSettings  settings,
PauseCallback  pause 
) throws com.foxit.sdk.PDFException
static

Optimize the given PDF document with specified optimizers settings.

Parameters
[in]docA valid PDF document object to be optimized.
[in]settingsSetting data used for optimization processing settings.
[in]pausePause object which decides if the process needs to be paused. This can be null which means not to pause during the optimization process. If this is not null, it should be a valid pause object implemented by user.
Note
If module "Optimizer" is not defined in the license information which is used in function common.Library.initialize , that means user has no right in using Optimization related functions and this function will throw exception com.foxit.sdk.common.Constants.e_ErrInvalidLicense .
Returns
A progressive object. Please check the rate of current progress by function common.Progressive.getRateOfProgress . If the rate is not 100 yet, call function common.Progressive.resume to coninue the progress until the progress is finished.