PDF Parser Options
Use the parsers option to control PDF parsing behavior.
Typical configuration
Section titled “Typical configuration”parsers: [{ type: 'pdf' }]You can also use the shorthand form:
parsers: ['pdf']Field reference
Section titled “Field reference”| Field | Meaning |
|---|---|
type | Parser type. PDFs use pdf. |
mode | Parsing mode: fast / auto / ocr. |
maxPages | Max pages to process. A direct cost/time guardrail. |
Defaults and billing
Section titled “Defaults and billing”parsersincludes PDF parsing by default (PDF → Markdown)- PDFs are billed per page (1 credit / page)
- Passing an empty array
parsers: []skips PDF parsing and returns the PDF as base64 (flat 1 credit per PDF)
Recommended presets
Section titled “Recommended presets”- Unknown PDFs:
{ type: 'pdf', mode: 'auto' } - Text-native PDFs:
{ type: 'pdf', mode: 'fast' } - Scans/photos:
{ type: 'pdf', mode: 'ocr' }
Related: