| paddle_ocr | R Documentation |
This is the main entry point for the PaddleOCR cloud API. Submit a local file (image or document) or a URL, and the function will handle job submission, polling, result retrieval, and file saving automatically.
paddle_ocr(
file_path,
output_dir = "output",
token = "",
job_url = "",
model = "",
use_doc_orientation_classify = FALSE,
use_doc_unwarping = FALSE,
use_chart_recognition = FALSE,
poll_interval = 5,
max_wait_seconds = 3600,
timeout = 600
)
file_path |
A local file path or a URL ( |
output_dir |
Directory to save output Markdown and images
(default: |
token |
PaddleOCR API bearer token. If empty, reads from the
|
job_url |
PaddleOCR API endpoint. Defaults to the official cloud URL. |
model |
Model name to use. Defaults to |
use_doc_orientation_classify |
Logical; enable document orientation classification. |
use_doc_unwarping |
Logical; enable document unwarping. |
use_chart_recognition |
Logical; enable chart/table recognition. |
poll_interval |
Seconds between status checks (default: 5). |
max_wait_seconds |
Maximum wait time for job completion (default: 3600). |
timeout |
HTTP request timeout in seconds (default: 600). |
A list with elements:
Input file path or URL.
The submitted job ID.
Output directory path.
Paths to saved Markdown files.
Number of pages processed.
## Not run:
# OCR a local image
result <- paddle_ocr("document.png")
# OCR a URL
result <- paddle_ocr("https://example.com/document.jpg")
# With custom options
result <- paddle_ocr(
file_path = "table.png",
use_chart_recognition = TRUE,
output_dir = "my_output"
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.