submit_paddle_job: Submit an OCR job to the PaddleOCR cloud API

View source: R/submit.R

submit_paddle_jobR Documentation

Submit an OCR job to the PaddleOCR cloud API

Description

Submits a local file or a URL for OCR processing. The function detects whether the input is a URL or a local file path and uses the appropriate API call method (JSON body vs. multipart upload).

Usage

submit_paddle_job(
  file_path,
  token = "",
  job_url = "",
  model = "",
  use_doc_orientation_classify = FALSE,
  use_doc_unwarping = FALSE,
  use_chart_recognition = FALSE,
  timeout = 600
)

Arguments

file_path

A local file path or a URL (http:// or https://).

token

PaddleOCR API bearer token. If empty, reads from the PADDLE_OCR_TOKEN environment variable.

job_url

PaddleOCR API endpoint. Defaults to the official cloud URL.

model

Model name to use. Defaults to "PaddleOCR-VL-1.6".

use_doc_orientation_classify

Logical; enable document orientation classification.

use_doc_unwarping

Logical; enable document unwarping.

use_chart_recognition

Logical; enable chart/table recognition.

timeout

HTTP request timeout in seconds (default: 600).

Value

A character string containing the job ID.

Examples

## Not run: 
# Submit a local image
job_id <- submit_paddle_job(
  file_path = "document.png",
  token = "your_token_here"
)

# Submit a URL
job_id <- submit_paddle_job(
  file_path = "https://example.com/document.jpg",
  token = "your_token_here"
)

## End(Not run)

PaddleOCR documentation built on Aug. 30, 2026, 5:07 p.m.