✓ Verified ✍️ Content Creation ✓ Enhanced Data

Paddleocr Doc Parsing V2

Parse documents using PaddleOCR's API.

Rating
4.5 (217 reviews)
Downloads
1,619 downloads
Version
1.0.0

Overview

Parse documents using PaddleOCR's API.

Key Features

1

Multi-format support: PDF and image files (JPG, PNG, BMP, TIFF)

2

Two parsing modes:

3

Sync mode: Fast response for small files (<600s timeout)

4

Async mode: For large files with progress polling

5

Layout analysis: Automatic detection of text blocks, tables, formulas

6

Multi-language: Support for 110+ languages

7

Structured output: Markdown format with preserved document structure

Complete Documentation

View Source →

PaddleOCR Document Parsing

Parse images and PDF files using PaddleOCR's API. Supports both synchronous and asynchronous parsing modes with structured output.

Resource Links

ResourceLink
Official Websitehttps://www.paddleocr.com
API Documentationhttps://ai.baidu.com/ai-doc/AISTUDIO/Cmkz2m0ma
GitHubhttps://github.com/PaddlePaddle/PaddleOCR

Key Features

  • Multi-format support: PDF and image files (JPG, PNG, BMP, TIFF)
  • Two parsing modes:
  • Sync mode: Fast response for small files (<600s timeout)
  • Async mode: For large files with progress polling
  • Layout analysis: Automatic detection of text blocks, tables, formulas
  • Multi-language: Support for 110+ languages
  • Structured output: Markdown format with preserved document structure

Setup

  • Visit PaddleOCR to obtain your API credentials
  • Set environment variables:
bash
export PADDLEOCR_ACCESS_TOKEN="your_token_here"
export PADDLEOCR_API_URL="https://your-endpoint.aistudio-app.com/layout-parsing"

# Optional: For async mode
export PADDLEOCR_JOB_URL="https://your-job-endpoint.aistudio-app.com/api/v2/ocr/jobs"
export PADDLEOCR_MODEL="PaddleOCR-VL-1.5"

Usage Examples

Sync Mode (Default)

For small files and quick processing:

bash
# Parse local image
{baseDir}/paddleocr_parse.sh document.jpg

# Parse PDF
{baseDir}/paddleocr_parse.sh -t pdf document.pdf

# Parse from URL
{baseDir}/paddleocr_parse.sh https://example.com/document.jpg

# Save output to file
{baseDir}/paddleocr_parse.sh -o result.json document.jpg

# Verbose output
{baseDir}/paddleocr_parse.sh -v document.jpg

Async Mode

For large files with progress tracking:

bash
# Parse large PDF with async mode
{baseDir}/paddleocr_parse.sh --async large-document.pdf

# Parse from URL with async mode
{baseDir}/paddleocr_parse.sh --async -t pdf https://example.com/doc.pdf

# Save async result to file
{baseDir}/paddleocr_parse.sh --async -o result.json document.pdf

Using Python Script Directly

bash
# Sync mode
python3 {baseDir}/paddleocr_parse.py document.jpg

# Async mode
python3 {baseDir}/paddleocr_parse.py --async-mode document.pdf

# With output file
python3 {baseDir}/paddleocr_parse.py -o result.json --async-mode document.pdf

Response Structure

json
{
  "logId": "unique_request_id",
  "errorCode": 0,
  "errorMsg": "Success",
  "result": {
    "layoutParsingResults": [
      {
        "prunedResult": [...],
        "markdown": {
          "text": "# Document Title\n\nParagraph content...",
          "images": {}
        },
        "outputImages": [...],
        "inputImage": "http://input-image"
      }
    ],
    "dataInfo": {...}
  }
}

Important Fields:

  • prunedResult - Contains detailed layout element information including positions, categories, etc.
  • markdown - Stores the document content converted to Markdown format with preserved structure and formatting.

Mode Selection Guide

Use CaseRecommended Mode
Small images (< 10MB)Sync
Single page PDFsSync
Large PDFs (> 10MB)Async
Multi-page documentsAsync
Batch processingAsync
Quick text extractionSync

Error Handling

The script will exit with code 1 and print error message for:

  • Missing required environment variables
  • File not found
  • API authentication failures
  • Invalid JSON responses
  • API error codes (non-zero)

Quota Information

See official documentation: https://ai.baidu.com/ai-doc/AISTUDIO/Xmjclapam

Installation

Terminal bash

openclaw install paddleocr-doc-parsing-v2
    
Copied!

💻Code Examples

export PADDLEOCR_MODEL="PaddleOCR-VL-1.5"

export-paddleocrmodelpaddleocr-vl-15.txt
## Usage Examples

### Sync Mode (Default)

For small files and quick processing:

{baseDir}/paddleocr_parse.sh -v document.jpg

basedirpaddleocrparsesh--v-documentjpg.txt
### Async Mode

For large files with progress tracking:
example.sh
export PADDLEOCR_ACCESS_TOKEN="your_token_here"
export PADDLEOCR_API_URL="https://your-endpoint.aistudio-app.com/layout-parsing"

# Optional: For async mode
export PADDLEOCR_JOB_URL="https://your-job-endpoint.aistudio-app.com/api/v2/ocr/jobs"
export PADDLEOCR_MODEL="PaddleOCR-VL-1.5"
example.sh
# Parse local image
{baseDir}/paddleocr_parse.sh document.jpg

# Parse PDF
{baseDir}/paddleocr_parse.sh -t pdf document.pdf

# Parse from URL
{baseDir}/paddleocr_parse.sh https://example.com/document.jpg

# Save output to file
{baseDir}/paddleocr_parse.sh -o result.json document.jpg

# Verbose output
{baseDir}/paddleocr_parse.sh -v document.jpg
example.sh
# Parse large PDF with async mode
{baseDir}/paddleocr_parse.sh --async large-document.pdf

# Parse from URL with async mode
{baseDir}/paddleocr_parse.sh --async -t pdf https://example.com/doc.pdf

# Save async result to file
{baseDir}/paddleocr_parse.sh --async -o result.json document.pdf
example.sh
# Sync mode
python3 {baseDir}/paddleocr_parse.py document.jpg

# Async mode
python3 {baseDir}/paddleocr_parse.py --async-mode document.pdf

# With output file
python3 {baseDir}/paddleocr_parse.py -o result.json --async-mode document.pdf
example.json
{
  "logId": "unique_request_id",
  "errorCode": 0,
  "errorMsg": "Success",
  "result": {
    "layoutParsingResults": [
      {
        "prunedResult": [...],
        "markdown": {
          "text": "# Document Title\n\nParagraph content...",
          "images": {}
        },
        "outputImages": [...],
        "inputImage": "http://input-image"
      }
    ],
    "dataInfo": {...}
  }
}

Tags

#image_and-video-generation #api

Quick Info

Category Content Creation
Model Claude 3.5
Complexity One-Click
Author hiotec
Last Updated 3/10/2026
🚀
Optimized for
Claude 3.5
🧠

Ready to Install?

Get started with this skill in seconds

openclaw install paddleocr-doc-parsing-v2