PDF Generation Template Editor
Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.
Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.
The ocrRecognitionLang parameter specifies the OCR recognition language code. The current API uses the original OCR model language codes. Defaults to AUTO (automatic detection).
| Code | Language |
|---|---|
AUTO | Auto Detect |
CHINESE | Simplified Chinese |
CHINESE_TRAD | Traditional Chinese |
ENGLISH | English |
KOREAN | Korean |
JAPANESE | Japanese |
LATIN | Latin script |
DEVANAGARI | Devanagari script |
CYRILLIC | Cyrillic script |
ARABIC | Arabic script |
TAMIL | Tamil |
TELUGU | Telugu |
KANNADA | Kannada |
THAI | Thai |
GREEK | Greek |
ESLAV | East Slavic languages |
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:
["RMNOTUSE", "RMEPTOBJ", "BCOMPRESSIMAGE"]| Flag | Description |
|---|---|
RMNOTUSE | Remove unused objects |
RMEPTOBJ | Remove empty objects |
RMSPEATTR | Remove special attributes |
RMEMBFONT | Remove embedded fonts |
RMINVALINK | Remove invalid links |
RMINVABK | Remove invalid bookmarks |
BCOMPRESSIMAGE | Compress images |
RMBK | Remove bookmarks |
RMANNOT | Remove annotations |
RMFORM | Remove forms |
RMMULMEDIA | Remove multimedia content |
RMDOCINFO | Remove document information |
RMMEDTADATA | Remove metadata |
RMOBJDATA | Remove object data |
RMFILEATTACHMENT | Remove file attachments |
RMEXTERNCROSSREF | Remove external cross-references |
RMOTHERAPPDATA | Remove other application data |
RMHIDERLAYER | Remove hidden layers |
MERGEVISIBLELAYER | Merge visible layers |
USEFLATE | Use Flate compression |
FLAT_REPLACELZW | Replace LZW compression with Flate |
RMUNUSEDTARGET | Remove unused targets |
OPTIMIZEPAGECONTENT | Optimize page content |
OPTIMIZEPDFFASTWEBVIEW | Optimize for Fast Web View (linearization) |
RMFORMCOMMITIMPORTRESETACTION | Remove form submit/import/reset actions |
RMJSACTION | Remove JavaScript actions |
RMPAGETHUMBNAIL | Remove page thumbnails |
RMREPLACEIMAGE | Replace images |
RMLABEL | Remove page labels |
RMPRINTSETTINGS | Remove print settings |
RMSEARCHINDEX | Remove search index |
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 Range | Technical Meaning | Actual Effect |
|---|---|---|
| 0 | Maximum Quantization (Highest Compression) | Severe distortion, resulting in solid color blocks |
| 50 | Medium Quantization | Visible quality loss, suitable for web thumbnails |
| 75-80 | Default Recommended Value | Good balance (quality/size), suitable for most scenarios |
| 95-100 | Minimal 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.
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 Range | Technical Meaning | Actual Effect |
|---|---|---|
| 0 | Maximum quantization (highest compression) | Severe distortion, resulting in solid color blocks |
| 50 | Medium quantization | Visible quality loss, suitable for web thumbnails |
| 75-80 | Default recommended value | Good balance (quality/size), suitable for most scenarios |
| 95-100 | Minimum 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 Value | Description |
|---|---|
unspecified | Unspecified language |
cs_CZ | Czech (Czech Republic) |
de_DE | German (Germany) |
en_GB | English (United Kingdom) |
en_US | English (United States) |
es_ES | Spanish (Spain) |
fi_FI | Finnish (Finland) |
fr_FR | French (France) |
hu_HU | Hungarian (Hungary) |
it_IT | Italian (Italy) |
ja_JP | Japanese (Japan) |
ko_KR | Korean (South Korea) |
nl_BE | Dutch (Belgium) |
nl_NL | Dutch (Netherlands) |
no_NO | Norwegian (Norway) |
pl_PL | Polish (Poland) |
pt_BR | Portuguese (Brazil) |
pt_PT | Portuguese (Portugal) |
ru_RU | Russian (Russia) |
sk_SK | Slovak (Slovakia) |
sv_SE | Swedish (Sweden) |
tr_TR | Turkish (Turkey) |
zh_CN | Chinese (Mainland China) |
zh_HK | Chinese (Hong Kong, China) |
zh_MO | Chinese (Macao, China) |
zh_TW | Chinese (Taiwan, China) |