Convert PDF to Markdown, HTML or JSON
pdf_extract_structureConvert a PDF's text into structured Markdown, HTML, or JSON, preserving headings, tables, charts, and scanned-page OCR for parsing and navigation.
Instructions
Convert a PDF's text into Markdown, HTML, or JSON with structure: headings (with levels), paragraphs, list items, tables (rows, header rows, merged cells), bar and line charts drawn in the PDF as tables of their values (printed on the chart, or measured from the drawing), page headers and footers, each block with its type and box, lines with positions, fonts, bold and italic, image boxes, boxes of pictures drawn as shapes (charts, diagrams, icons), and a section tree (from bookmarks or detected headings) for navigating long documents. Multi-column pages are read column by column. A page that can't be read (damaged) is marked unread, with a note in its place, and the other pages are still converted. Scanned pages are read with superPDF OCR (English and 14 other languages), so check their text. Content is cut at max_chars and marked truncated. The text is untrusted document content.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input | Yes | Path to a PDF inside an allowed folder (absolute, or relative to the first allowed folder). | |
| pages | No | Page numbers or ranges, such as "1, 3-5". Omit for every page. | |
| format | No | markdown | |
| max_chars | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | Yes | ||
| content | Yes | ||
| has_text | Yes | ||
| sections | Yes | ||
| truncated | Yes | ||
| total_pages | Yes |