Skip to content
ComPDF

Compression Parameters

optimizeFlags specifies which optimization actions to apply when compressing a PDF. When calling the PDF Compression API, you can pass multiple flags. In Try it, enter one flag per line; the request is submitted as a list.

You can also enter a JSON array, for example:

json
["RMNOTUSE", "RMEPTOBJ", "BCOMPRESSIMAGE"]
FlagDescription
RMNOTUSERemove unused objects
RMEPTOBJRemove empty objects
RMSPEATTRRemove special attributes
RMEMBFONTRemove embedded fonts
RMINVALINKRemove invalid links
RMINVABKRemove invalid bookmarks
BCOMPRESSIMAGECompress images
RMBKRemove bookmarks
RMANNOTRemove annotations
RMFORMRemove forms
RMMULMEDIARemove multimedia content
RMDOCINFORemove document information
RMMEDTADATARemove metadata
RMOBJDATARemove object data
RMFILEATTACHMENTRemove file attachments
RMEXTERNCROSSREFRemove external cross-references
RMOTHERAPPDATARemove other application data
RMHIDERLAYERRemove hidden layers
MERGEVISIBLELAYERMerge visible layers
USEFLATEUse Flate compression
FLAT_REPLACELZWReplace LZW compression with Flate
RMUNUSEDTARGETRemove unused targets
OPTIMIZEPAGECONTENTOptimize page content
OPTIMIZEPDFFASTWEBVIEWOptimize for Fast Web View (linearization)
RMFORMCOMMITIMPORTRESETACTIONRemove form submit/import/reset actions
RMJSACTIONRemove JavaScript actions
RMPAGETHUMBNAILRemove page thumbnails
RMREPLACEIMAGEReplace images
RMLABELRemove page labels
RMPRINTSETTINGSRemove print settings
RMSEARCHINDEXRemove search index