Generate your code#
PaddleOCR 3.7.0How to use the generated code#
Run the install block once#
It pins versions we've verified. If you already have PaddleOCR, check it's 3.x:
python -c "import paddleocr; print(paddleocr.__version__)".Point the script at your file#
Replace
document.png,report.pdforscans/with your path. URLs work too.Read the notes under the code#
They explain every automatic correction — for example why Japanese switches tiny to small, or why formula recognition turns off on ONNX Runtime.
Python, CLI, HTTP or JavaScript?#
| Target | Use it when | Limits |
|---|---|---|
| Python | You're building an app, batch job or notebook. | Needs Python 3.9+ for document pipelines. |
| CLI | You want a one-off conversion or a shell script. | Same options as Python; booleans are True/False. |
| HTTP client | OCR runs on a server and many clients call it. | Server processes the first 10 PDF pages by default. See serving. |
| Browser JS | You want OCR inside a web page, with no server. | Text OCR only; PP-OCRv6 small/tiny; PP-OCRv6 languages only. |
FAQ#
Is the generated code tested?
The building blocks are: we ran the OCR and PP-StructureV3 paths (CPU, PaddlePaddle 3.2.0 and ONNX Runtime) on PaddleOCR 3.7.0 for this site's benchmark, and every parameter name is checked against the installed 3.7.0 package. PaddleOCR-VL and GPU snippets follow the official docs; we haven't run them on a GPU ourselves.
Why does the PP-StructureV3 code set PP-OCRv6 models?
Because PaddleOCR 3.7's PP-StructureV3 still defaults to PP-OCRv5 server text models, and in our test the PP-OCRv6 models fixed three misread lines (four wrong characters) and ran about 10% faster. Delete those two lines to get the stock behaviour.
Can I generate code for PaddleOCR 2.x?
No — 2.x has a different API. If you have 2.x code, the migration converter upgrades it.
Where do I find more parameters?
The quick start & API page lists every PaddleOCR() parameter with its effective default; the PP-StructureV3 and PaddleOCR-VL guides cover theirs.
Sources
- Parameter names: PaddleOCR 3.7.0
paddleocr/_pipelines/ocr.py,pp_structurev3.py,paddleocr_vl.py(signatures inspected in an installed 3.7.0 environment on 2026-10-27). - HTTP API: official serving docs —
POST /ocr(OCR.en.md) andPOST /layout-parsingwithresult.layoutParsingResults[i].markdown.text(PP-StructureV3.en.md, PaddleOCR-VL.en.md). - PaddleOCR.js options: @paddleocr/paddleocr-js README (0.4.2).
- Compatibility notes (tiny/Japanese, ONNX Runtime speed, PP-StructureV3 text models): our benchmark.