Command-line mode
Short answer: EnjoyPDF can run without a window: --replace replaces one term, --batch uses a keyword table, --redact runs secure redaction, and --folder processes a whole folder. Exit code 0 means success, 1 failure, 2 usage error, 3 written but verification found problems.
Usage
PDFTextReplacer.exe --replace <input> <output> <find> <replace> [password]
PDFTextReplacer.exe --batch <input> <output> <keyword-table.xlsx|csv|txt> [password]
PDFTextReplacer.exe --redact <input> <output> [keywords.txt] [password]
PDFTextReplacer.exe --folder <input-folder> <output-folder> <keyword-table.xlsx|csv|txt>
--folderprocesses every PDF and image in the folder, including subfolders. It prints progress file by file and writes a processing report to the output folder.- To replace with nothing, pass
"". - Output messages follow the interface language setting. You can also set it with an environment variable such as
PDF_UI_LANG=en.
Environment variables
| Variable | Effect |
|---|---|
PDF_OCR_LANG=ch or th | Recognize one language only (default: Chinese + Thai) |
PDF_OCR_FAST=1 | Fast recognition: read with the small model only, without a second pass by the standard model |
PDF_TWO_STAGE=0 | Turn off two-stage recognition and use the standard model for all text |
PDF_ALIGN=left|right|center | Alignment |
PDF_OVERFLOW=allow|compress|contain | What to do when replacement text in an image is too long |
PDF_RISK_CONFIRM=1 | Allow changes to L2 (signed or issued) files; L3 files are never changed in place |
PDF_MANIFEST=0 | Do not write the operation record (manifest.json) |
Exit codes
| Exit code | Meaning |
|---|---|
| 0 | Success |
| 1 | Failure, including when the risk policy blocks the file |
| 2 | Usage error |
| 3 | The file was written, but read-back verification or the residue check found problems |
In scripts, treat exit code 3 as “needs manual review”, not as success.