tidewell/doc-to-markdown
tidewell--doc-to-markdownThis tool calls the Actor "tidewell/doc-to-markdown" and retrieves its output results. Actor description: Returns clean Markdown, or token-sized chunks with page and heading metadata, for each PDF, DOCX, PPTX, XLSX, HTML, EPUB or scanned image. Tables become Markdown tables; scans are read with Tesseract OCR in 25 languages. For RAG, LangChain and LlamaIndex. Pay per document and page.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "tidewell--doc-to-markdown"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ocr | No | Run Tesseract OCR on images and on PDF pages without a usable text layer. Pages with a text layer are read directly (faster and exact). Example values: true | |
| ocrDpi | No | Resolution at which scanned PDF pages are rendered for OCR. 300 is a good balance; use 400 for small print. Example values: 300 | |
| chunking | No | none: one chunk per page (JSON output). heading: one chunk per section, long sections split by tokens. tokens: fixed-size token windows with overlap that respect paragraph and table boundaries. Example values: "none" | none |
| fileUrls | No | Direct links to PDF, DOCX, PPTX, XLSX/XLS, HTML, EPUB, CSV, JSON, XML, TXT/MD files or PNG/JPEG/TIFF/WebP/GIF/BMP images. Google Drive, Dropbox and GitHub share links are converted to direct downloads automatically. Example values: ["https://arxiv.org/pdf/1706.03762v7"] | |
| forceOcr | No | OCR every page even if it has a text layer. Use for PDFs whose embedded text is garbled. | |
| waitSecs | No | Max seconds (0–45, default 30) to cap the wait for the Actor run to reach terminal state. For long-running Actors the response returns at the cap with the current run status; follow `nextStep` to poll via get-actor-run. Set to 0 to fire-and-forget. | |
| chunkSize | No | Maximum tokens per chunk (cl100k_base tokenizer, as used by OpenAI embedding models). Example values: 512 | |
| datasetId | No | Take file URLs from the items of an Apify dataset, e.g. links collected by a crawler. | |
| pageRange | No | Pages to convert, e.g. "1-5,8,10-". Applies to PDF pages, slides, spreadsheet sheets and multi-page TIFF frames. Empty = all. | |
| httpHeaders | No | Headers sent with every download, e.g. {"Authorization": "Bearer ..."} for private file servers. | |
| pageMarkers | No | Add <!-- page N --> comments between pages in the Markdown (PDF, slides, multi-page images). Useful for citations. | |
| pdfPassword | No | Password for encrypted PDFs (used for every PDF in the run). | |
| chunkOverlap | No | Tokens repeated from the end of the previous chunk. Capped at half the chunk size. Example values: 64 | |
| minImageSize | No | Skip images narrower or shorter than this (icons, bullets, spacer images). Example values: 64 | |
| ocrLanguages | No | Tesseract language codes. Installed: eng, deu, fra, spa, ita, por, nld, pol, ces, swe, dan, nor, fin, tur, rus, ukr, ell, ara, heb, hin, chi_sim, chi_tra, jpn, kor, vie. Combine several for mixed documents (slower). Example values: ["eng"] | |
| outputFormat | No | markdown: each dataset row holds the full Markdown. json: each row holds chunks[] with page and heading metadata (the full Markdown is still saved to the key-value store). Example values: "markdown" | markdown |
| extractImages | No | Save embedded images to the key-value store and link them from the Markdown (). | |
| extractTables | No | Detect ruled tables in PDFs and output them as Markdown tables. Word, PowerPoint, Excel and HTML tables are always converted to Markdown tables. Example values: true | |
| maxFileSizeMb | No | Files larger than this are skipped (not charged). Example values: 100 | |
| uploadedFiles | No | Upload files from your computer. They are stored in a key-value store and processed like file URLs. | |
| maxConcurrency | No | Documents converted in parallel. Each extra 4 GB of memory gives the run one more CPU core. Example values: 3 | |
| datasetUrlField | No | Item field that holds the file URL (a string or a list of strings). Example values: "url" | url |
| keyValueStoreId | No | Convert files stored in an Apify key-value store (for example the output of another Actor). Use "default" for this run's own store. | |
| keyValueStoreKeys | No | Keys to convert. Leave empty to convert every record in the store (optionally filtered by prefix). | |
| documentTimeoutSecs | No | Conversion of one document is stopped after this time and reported as failed (not charged). Example values: 300 | |
| downloadTimeoutSecs | No | Maximum time to download one file. Example values: 120 | |
| htmlMainContentOnly | No | Drop navigation, headers, footers and sidebars from HTML pages and keep <main>/<article> when present. Example values: true | |
| keyValueStorePrefix | No | When no keys are listed, only records whose key starts with this prefix are converted. | |
| maxPagesPerDocument | No | Safety cap on pages converted per document. Example values: 1000 | |
| maxImagesPerDocument | No | Stop extracting images after this many per document. Example values: 200 | |
| removeHeadersFooters | No | Drop text repeated at the top or bottom of most PDF pages. Example values: true |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tip | No | Advisory guidance RAG Web Browser wrote to its key-value store under the reserved "TIP" key | |
| runId | Yes | Actor run ID | |
| stats | No | Run statistics | |
| status | Yes | Run status: READY | RUNNING | TIMING-OUT | TIMED-OUT | ABORTING | ABORTED | SUCCEEDED | FAILED | |
| actorId | Yes | Stable Apify Actor ID from the run record | |
| summary | Yes | Past-tense summary of the run state | |
| exitCode | No | Actor process exit code; populated for terminal states (especially FAILED) | |
| nextStep | Yes | One primary follow-up action with identifiers interpolated | |
| storages | Yes | Dataset and key-value store metadata, keyed by alias. "default" is always the primary entry. | |
| actorName | No | "username/actor-name" | |
| startedAt | No | ISO timestamp when the run started | |
| finishedAt | No | ISO timestamp when the run finished (terminal states only) | |
| statusMessage | No | Pass-through from Apify run.statusMessage | |
| apifyConsoleUrl | No | Personalized Apify Console link to the run; present only for Console sessions |