PDF Conversion Router
Route every PDF conversion through a short analysis step before choosing tools or CLI flags.
The goal is not "extract the most text". The goal is:
- preserve structure
- preserve attachment between labels and values
- choose the most faithful output shape
- avoid noisy defaults when a better route exists
When to Use
- The user wants a PDF converted into another format.
- The requested output is
.md, .html, .txt, .json, .docx, or structured notes.
- The PDF may be scanned, OCR-heavy, table-heavy, slide-based, medical, academic, or multi-column.
Core Rule
Never start with one fixed default pipeline.
Always:
- classify the PDF
- classify the target output
- choose the strongest route for that combination
- validate the result on representative sections
- if needed, retry with better settings before delivering
Heuristics are starting points, not guarantees.
Do not promote one flag combination into a universal default just because it worked well on one PDF.
Prefer document-specific evidence over habit.
Primary Engine Rule
Use opendataloader-pdf as the primary conversion engine for every PDF conversion task by default.
This skill should assume:
opendataloader-pdf is always the first conversion attempt
- other tools are used to classify, validate, OCR, inspect, or support cleanup
- other extractors are not the default replacement for the main conversion route
Use other tools only for one of these reasons:
- quick classification of the PDF
- OCR preprocessing before conversion
- validation against layout-preserving text
- manual repair when the generated output is still noisy
- fallback only if
opendataloader-pdf cannot produce a usable result
Step 1: Classify the Source PDF
Identify the document class as quickly as possible:
- Native digital PDF with selectable text
- OCR PDF with noisy text
- Image-only/scanned PDF
- Slide deck / presentation export
- Medical or lab report
- Table-heavy business/finance document
- Narrative report / letter / article
- Mixed layout document with diagrams, tables, and prose
Useful fast checks:
pdfinfo input.pdf
pdftotext -layout input.pdf -
If text is missing or very poor, treat OCR as required.
Document-Type Heuristics
Use these as default starting points:
medical / lab report
markdown-with-html + --table-method cluster + --image-output off
slide deck / PowerPoint export
markdown-with-html + --image-output off
add --table-method cluster only if the default route under-structures important tabular content
if tables are visually obvious but missing or badly fused, treat this as a detection problem, not a Markdown formatting problem
if the selected route already reconstructs a real table but clips leading characters at column boundaries, treat that as a boundary-splitting defect, not a missing-table failure
narrative / article / letter
start with markdown or text
use markdown-with-html only if structure clearly matters
table-heavy business / finance PDF
start with markdown-with-html
add --table-method cluster when rows or columns flatten
scanned / image-heavy PDF
OCR first, then convert with opendataloader-pdf
mixed-layout PDF
prefer markdown-with-html
validate one easy section and one hard section before accepting output
Step 2: Choose the Output Shape
Pick the output that best matches the document and the user's goal.
markdown-with-html
Use by default when the user wants Markdown and fidelity matters.
Prefer this for tables, medical reports, slides, mixed-layout PDFs, and anything likely to break in pure Markdown.
markdown
Use only when clean plain Markdown matters more than layout fidelity.
html
Use when visual structure matters more than LLM readability.
text
Use for quick linear extraction, narrative documents, or when structure is unimportant.
json
Use when downstream machine processing matters more than human readability.
docx
Use when the user wants editable office output and layout reconstruction matters.
Step 3: Choose the Extraction Route
For OpenDataLoader CLI
Use OpenDataLoader as the default route.
Preferred defaults:
For Markdown output with fidelity priority:
-f markdown-with-html
For medical PDFs:
add --table-method cluster
For table-heavy PDFs:
add --table-method cluster
For slide decks:
start without --table-method cluster
add it only after a structure check shows meaningful improvement
if a pseudo-table is already collapsed inside one detected row, changing only the Markdown flavor usually will not fix it
if the active engine build recovers the pseudo-table structure, prefer fixing residual boundary artifacts before escalating to hybrid/full mode
For conversions where images are not requested:
add --image-output off
For slide decks, medical reports, and structure-sensitive PDFs:
prefer validating both the
1---2name: pdf-conversion-router3description: Use when converting a PDF into another format such as Markdown, HTML, text, JSON, DOCX, or structured notes and the agent must choose the best extraction route, settings, and cleanup strategy for maxi4category: Document Processing5source: antigravity6tags: [pdf, docx, markdown, ai, agent, llm, document, presentation, image, rag]7url: https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/pdf-conversion-router8metadata:9 source: https://skillmd.com/skills/ranbot-ai/pdf-conversion-router10---111213# PDF Conversion Router1415Route every PDF conversion through a short analysis step before choosing tools or CLI flags.1617The goal is not "extract the most text". The goal is:18- preserve structure19- preserve attachment between labels and values20- choose the most faithful output shape21- avoid noisy defaults when a better route exists2223## When to Use2425- The user wants a PDF converted into another format.26- The requested output is `.md`, `.html`, `.txt`, `.json`, `.docx`, or structured notes.27- The PDF may be scanned, OCR-heavy, table-heavy, slide-based, medical, academic, or multi-column.2829## Core Rule3031Never start with one fixed default pipeline.3233Always:341. classify the PDF352. classify the target output363. choose the strongest route for that combination374. validate the result on representative sections385. if needed, retry with better settings before delivering3940Heuristics are starting points, not guarantees.4142Do not promote one flag combination into a universal default just because it worked well on one PDF.43Prefer document-specific evidence over habit.4445## Primary Engine Rule4647Use `opendataloader-pdf` as the primary conversion engine for every PDF conversion task by default.4849This skill should assume:50- `opendataloader-pdf` is always the first conversion attempt51- other tools are used to classify, validate, OCR, inspect, or support cleanup52- other extractors are not the default replacement for the main conversion route5354Use other tools only for one of these reasons:55- quick classification of the PDF56- OCR preprocessing before conversion57- validation against layout-preserving text58- manual repair when the generated output is still noisy59- fallback only if `opendataloader-pdf` cannot produce a usable result6061## Step 1: Classify the Source PDF6263Identify the document class as quickly as possible:6465- Native digital PDF with selectable text66- OCR PDF with noisy text67- Image-only/scanned PDF68- Slide deck / presentation export69- Medical or lab report70- Table-heavy business/finance document71- Narrative report / letter / article72- Mixed layout document with diagrams, tables, and prose7374Useful fast checks:7576```bash77pdfinfo input.pdf78pdftotext -layout input.pdf -79```8081If text is missing or very poor, treat OCR as required.8283## Document-Type Heuristics8485Use these as default starting points:8687- medical / lab report88 `markdown-with-html + --table-method cluster + --image-output off`8990- slide deck / PowerPoint export91 `markdown-with-html + --image-output off`92 add `--table-method cluster` only if the default route under-structures important tabular content93 if tables are visually obvious but missing or badly fused, treat this as a detection problem, not a Markdown formatting problem94 if the selected route already reconstructs a real table but clips leading characters at column boundaries, treat that as a boundary-splitting defect, not a missing-table failure9596- narrative / article / letter97 start with `markdown` or `text`98 use `markdown-with-html` only if structure clearly matters99100- table-heavy business / finance PDF101 start with `markdown-with-html`102 add `--table-method cluster` when rows or columns flatten103104- scanned / image-heavy PDF105 OCR first, then convert with `opendataloader-pdf`106107- mixed-layout PDF108 prefer `markdown-with-html`109 validate one easy section and one hard section before accepting output110111## Step 2: Choose the Output Shape112113Pick the output that best matches the document and the user's goal.114115- `markdown-with-html`116 Use by default when the user wants Markdown and fidelity matters.117 Prefer this for tables, medical reports, slides, mixed-layout PDFs, and anything likely to break in pure Markdown.118119- `markdown`120 Use only when clean plain Markdown matters more than layout fidelity.121122- `html`123 Use when visual structure matters more than LLM readability.124125- `text`126 Use for quick linear extraction, narrative documents, or when structure is unimportant.127128- `json`129 Use when downstream machine processing matters more than human readability.130131- `docx`132 Use when the user wants editable office output and layout reconstruction matters.133134## Step 3: Choose the Extraction Route135136### For OpenDataLoader CLI137138Use OpenDataLoader as the default route.139140Preferred defaults:141142- For Markdown output with fidelity priority:143 `-f markdown-with-html`144145- For medical PDFs:146 add `--table-method cluster`147148- For table-heavy PDFs:149 add `--table-method cluster`150151- For slide decks:152 start without `--table-method cluster`153 add it only after a structure check shows meaningful improvement154 if a pseudo-table is already collapsed inside one detected row, changing only the Markdown flavor usually will not fix it155 if the active engine build recovers the pseudo-table structure, prefer fixing residual boundary artifacts before escalating to hybrid/full mode156157- For conversions where images are not requested:158 add `--image-output off`159160- For slide decks, medical reports, and structure-sensitive PDFs:161 prefer validating both the