agentleFS
PKUfudaweiPKUfudawei/arxiv-skills/skills/pdf-parser/SKILL.md

pdf-parser

Skill22 starsChanged 3 months agoMITView on GitHub

Convert PDF papers to markdown using PaddleOCR API

  • Reads credentials

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. kimmihyeon12/skills★ 0same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repositoryOne other file it gives its agents.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Save Output: Write combined markdown file with embedded image references

    line 26

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

pdf-parser

Convert PDF papers to markdown format using PaddleOCR-VL-1.5 API, with automatic image extraction and layout preservation.

Overview

This skill uses PaddleOCR's cloud API to convert PDF academic papers into markdown format. It preserves document structure, extracts text content, and downloads embedded images.

Workflow

PDF Files → PaddleOCR API → JSONL Result → Markdown + Images

Processing Steps

  1. Submit Job: Upload each PDF to PaddleOCR API
  2. Wait for Result: Poll job status until completion
  3. Download & Merge: Fetch JSONL result, extract markdown text and images
  4. Save Output: Write combined markdown file with embedded image references

Setup

1. Obtain PaddleOCR API Token

Get your API token from PaddleOCR AI Studio and set the environment variable:

export PADDLE_TOKEN="your_token_here"

Or add to ~/.bashrc or .env file for persistent configuration:

echo 'export PADDLE_TOKEN="your_token_here"' >> ~/.bashrc
source ~/.bashrc

Usage

Basic Usage

python3 skills/pdf-parser/scripts/paddleOCR.py -f "path/to/pdfs/*.pdf"

Process Multiple Directories

# Process all PDFs in arxiv subdirectories
python3 skills/pdf-parser/scripts/paddleOCR.py -f "arxiv/*/*.pdf"

# Process specific directory
python3 skills/pdf-parser/scripts/paddleOCR.py -f "/home/user/papers/*.pdf"

Args

ArgumentShortDefaultDescription
--files-f(required)Glob pattern(s) for PDF files to process (e.g. "arxiv/*/*.pdf")
--workers5Maximum parallel PDF processing threads

Output Format

File Naming

  • Input: paper_123.pdf
  • Output: paper_123.md (same directory as input)

Markdown Structure

  • Text content extracted and preserved in reading order
  • Images saved as separate files with references in markdown
  • Layout structure maintained (headers, paragraphs, lists)

Image Handling

  • Images extracted from PDF are downloaded separately
  • Saved in the same directory as the markdown file
  • Referenced in markdown using standard image syntax

Configuration

API Settings (Hardcoded)

SettingValueDescription
MODELPaddleOCR-VL-1.5OCR model version
useDocOrientationClassifyFalseDisable auto-orientation
useDocUnwarpingFalseDisable document unwarping
useChartRecognitionFalseDisable chart recognition

Concurrency Settings

ParameterValueDescription
--workers5Maximum parallel PDF processing threads
semaphore5Maximum concurrent API requests

Example

Convert Single Directory

# Convert all PDFs in the papers directory
python3 skills/pdf-parser/scripts/paddleOCR.py -f "./papers/*.pdf"

# Output:
# ./papers/paper1.pdf → ./papers/paper1.md
# ./papers/paper2.pdf → ./papers/paper2.md

Convert arXiv Download Directory

# Typical workflow after arxiv-retriever download
python3 skills/pdf-parser/scripts/paddleOCR.py -f "arxiv/*/*.pdf"

# Output:
# arxiv/cs.LG/paper_123.pdf → arxiv/cs.LG/paper_123.md

Error Handling

  • Skipped Files: PDFs that already have a corresponding .md file are skipped
  • Failed Jobs: Server-side job failures / timeouts are reported with the job id via tqdm.write(); all failed paths are collected in ./failed_files.txt so the batch can be re-run
  • Network Errors: Request failures are caught and logged per-file
  • Exit Code: the script exits non-zero when any file failed or errored

Performance

  • Parallel Processing: Up to 5 PDFs processed concurrently by default (--workers)
  • Rate Limiting: Max 5 simultaneous API requests to avoid throttling
  • Progress Tracking: Real-time progress bar using tqdm

Dependencies

  • requests - HTTP API calls
  • tqdm - Progress bars
  • python-dotenv - Environment variable loading

Notes

  • Requires internet connection for API calls
  • API usage may be subject to quotas or billing
  • Large PDFs may take longer to process
  • Image files are downloaded separately and saved alongside markdown

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.