Skip to content

PDF Generation Template Editor

Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.

View on GitHub

Parameter Description ​

OCR Language Codes ​

The ocrRecognitionLang parameter specifies the OCR recognition language code. The current API uses the original OCR model language codes. Defaults to AUTO (automatic detection).

CodeLanguage
AUTOAuto Detect
CHINESESimplified Chinese
CHINESE_TRADTraditional Chinese
ENGLISHEnglish
KOREANKorean
JAPANESEJapanese
LATINLatin script
DEVANAGARIDevanagari script
CYRILLICCyrillic script
ARABICArabic script
TAMILTamil
TELUGUTelugu
KANNADAKannada
THAIThai
GREEKGreek
ESLAVEast Slavic languages

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

Image Quality ​

The imageQuality parameter (0-100) controls the lossy nature of JPEG compression, directly affecting image quality and file size. It can be passed as a parameter when calling the PDF Compression API.

Parameter RangeTechnical MeaningActual Effect
0Maximum Quantization (Highest Compression)Severe distortion, resulting in solid color blocks
50Medium QuantizationVisible quality loss, suitable for web thumbnails
75-80Default Recommended ValueGood balance (quality/size), suitable for most scenarios
95-100Minimal Quantization (Near Lossless)Close to original image quality, but file size increases significantly

Compressed images do not decrease linearly with quality parameters. The size reduction from 90 to 80 is much greater than from 60 to 50. Therefore, when using this parameter, you should choose the highest image quality within an acceptable size range to ensure display quality.

Color Image Quality ​

colorImageQuality Color image quality parameter (0-100) controls the lossy nature of JPEG compression, directly affecting image quality and file size. This parameter can be controlled when calling the PDF Compression API.

Parameter RangeTechnical MeaningActual Effect
0Maximum quantization (highest compression)Severe distortion, resulting in solid color blocks
50Medium quantizationVisible quality loss, suitable for web thumbnails
75-80Default recommended valueGood balance (quality/size), suitable for most scenarios
95-100Minimum quantization (near lossless)Close to original image quality, but file size increases significantly

The compressed image does not decrease linearly with the quality parameter. The size reduction from 90 to 80 is much greater than from 60 to 50. Therefore, when using this parameter, you should choose the highest image quality within an acceptable size range to ensure display quality.

uaConfig.language Values ​

Pass the case-sensitive SDK enum constant name from CPDFUAConfig.UALanguage. If omitted, the value defaults to unspecified.

Enum ValueDescription
unspecifiedUnspecified language
cs_CZCzech (Czech Republic)
de_DEGerman (Germany)
en_GBEnglish (United Kingdom)
en_USEnglish (United States)
es_ESSpanish (Spain)
fi_FIFinnish (Finland)
fr_FRFrench (France)
hu_HUHungarian (Hungary)
it_ITItalian (Italy)
ja_JPJapanese (Japan)
ko_KRKorean (South Korea)
nl_BEDutch (Belgium)
nl_NLDutch (Netherlands)
no_NONorwegian (Norway)
pl_PLPolish (Poland)
pt_BRPortuguese (Brazil)
pt_PTPortuguese (Portugal)
ru_RURussian (Russia)
sk_SKSlovak (Slovakia)
sv_SESwedish (Sweden)
tr_TRTurkish (Turkey)
zh_CNChinese (Mainland China)
zh_HKChinese (Hong Kong, China)
zh_MOChinese (Macao, China)
zh_TWChinese (Taiwan, China)