| pdf_to_markdown_with_paddle | R Documentation |
Renders PDF pages to images one by one, then submits them for OCR using
the PaddleOCR cloud API. Pages are processed in streaming batches:
once batch_trigger pages are rendered, OCR begins while rendering
continues.
pdf_to_markdown_with_paddle(
pdf_path,
output_dir = NULL,
combined_markdown = TRUE,
dpi = 300,
batch_trigger = 3,
workers = 1,
resume = TRUE,
token = "",
job_url = "",
model = "",
use_doc_orientation_classify = FALSE,
use_doc_unwarping = FALSE,
use_chart_recognition = FALSE,
poll_interval = 5,
max_wait_seconds = 1800,
timeout = 600,
...
)
pdf_path |
Path to the PDF file. |
output_dir |
Output directory. If |
combined_markdown |
Logical; if |
dpi |
Image resolution for rendering (default: 300). |
batch_trigger |
Number of pages to render before starting OCR (default: 3). |
workers |
Maximum number of OCR jobs submitted concurrently (default: 1). OCR runs concurrently on the PaddleOCR service; result polling remains local and sequential. |
resume |
Logical; reuse rendered page images, completed Markdown files,
and submitted job IDs from an interrupted run (default: |
token |
PaddleOCR API token. |
job_url |
PaddleOCR API endpoint. |
model |
Model name. |
use_doc_orientation_classify |
Logical; enable orientation classification. |
use_doc_unwarping |
Logical; enable document unwarping. |
use_chart_recognition |
Logical; enable chart recognition. |
poll_interval |
Polling interval in seconds. |
max_wait_seconds |
Maximum wait time per job. |
timeout |
HTTP timeout. |
... |
Ignored (for future compatibility). |
Requires the pdftools package.
A list with PDF path, image paths, Markdown file paths, combined Markdown path and text, and output directory.
## Not run:
result <- pdf_to_markdown_with_paddle("document.pdf")
cat(result$combined_markdown_text)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.