Output Formats
PDFPipe supports 10 output formats across three categories. Set the format field in your convert request to choose one, and optionally pages (for example "1-5" or "last") to limit which pages are included.
returnMethod: "inline"): Text-oriented extraction formats (json, text, markdown, xml, csv) are usually the best fit for embedding in the JSON API response. Encoded and image formats (base64, binary, png, jpg, webp) are returned as Base64 strings when inline; the response includes contentEncoding: "base64" and a matching contentType (e.g. image/png). Very large outputs may fall back to a presigned URL with returnMethodFallback and returnMethodFallbackReason.| Format | Value | Category | Content-Type | Tiers |
|---|---|---|---|---|
| JSON | json | Extraction | application/json | All tiers |
| Text | text | Extraction | text/plain | All tiers |
| Markdown | markdown | Extraction | text/markdown | Starter+ |
| XML | xml | Extraction | application/xml | Starter+ |
| CSV | csv | Extraction | text/csv | Starter+ |
| Base64 | base64 | Encoded | text/plain | Starter+ |
| Binary | binary | Encoded | application/pdf | Starter+ |
| PNG | png | Image | image/png | Starter+ |
| JPG | jpg | Image | image/jpeg | Starter+ |
| WebP | webp | Image | image/webp | Starter+ |
Extraction Formats
Extraction formats read the text layer of the PDF and return it per page, plus the PDF's metadata. They work on digital-born PDFs with a text layer; scanned or image-only PDFs return empty text because there is no OCR. None of them detect tables, headings, or layout.
JSON
format: "json"Page-by-page text plus the PDF's own metadata (its Info dictionary) and the page count. Each page is { pageNumber, text }. There are no tables, coordinates, fonts, or bounding boxes.
{
"pages": [
{
"pageNumber": 1,
"text": "Invoice #2026-0142\nDate: February 15, 2026\n\nItem Qty Price\nAPI Credits 1000 $49.00..."
},
{
"pageNumber": 2,
"text": "Terms and conditions..."
}
],
"metadata": {
"Title": "Invoice #2026-0142",
"Author": "Acme Corp",
"Producer": "Acrobat Distiller 21.0",
"CreationDate": "D:20260215100000Z"
},
"totalPages": 2,
"extractedAt": "2026-08-23T12:00:01.840Z"
}Common use cases
- Data extraction pipelines that need page boundaries
- LLM / RAG document ingestion
- Reading the PDF's title, author, and creation date
Text
format: "text"Plain text extraction. All pages concatenated, in reading order as stored in the PDF, with blank lines between pages. No structural metadata.
Invoice #2026-0142
Date: February 15, 2026
Item Qty Price
API Credits 1000 $49.00
Priority 1 $29.00
Total: $78.00
Terms and conditions
Payment is due within 30 days...Common use cases
- Full-text search indexing
- Simple text processing
- Content previews
Markdown
format: "markdown"A top-level heading from the PDF's Title (or "Document" if it has none), then a "## Page N" heading followed by that page's plain text. Headings, lists, and tables inside the PDF are not detected; the page text is passed through as-is.
# Invoice #2026-0142
## Page 1
Invoice #2026-0142
Date: February 15, 2026
Item Qty Price
API Credits 1000 $49.00
## Page 2
Terms and conditions
Payment is due within 30 days...Common use cases
- LLM prompt context with page boundaries as headings
- Chunking documents by page for RAG pipelines
- Content migration
XML
format: "xml"A <document> with a <metadata> block (one element per PDF Info key, plus <totalPages>) and a <pages> block with one <page number="N"><text>...</text></page> per page. Useful for systems that consume XML natively.
<?xml version="1.0" encoding="UTF-8"?>
<document>
<metadata>
<Title>Invoice #2026-0142</Title>
<Author>Acme Corp</Author>
<totalPages>2</totalPages>
</metadata>
<pages>
<page number="1">
<text>Invoice #2026-0142
Date: February 15, 2026...</text>
</page>
<page number="2">
<text>Terms and conditions...</text>
</page>
</pages>
</document>Common use cases
- Enterprise system integrations
- XSLT transformation pipelines
- Legacy system compatibility
CSV
format: "csv"Two columns, page_number and text_content, with one row per page. Text is quoted and escaped per RFC 4180. This is not table extraction: tables inside the PDF are not detected.
page_number,text_content
1,"Invoice #2026-0142
Date: February 15, 2026
Item Qty Price
API Credits 1000 $49.00"
2,"Terms and conditions
Payment is due within 30 days..."Common use cases
- Loading page text into a spreadsheet or database, one row per page
- Feeding per-page text into tools that only accept CSV
- Quick page-count and text-length audits
Encoded Formats
Encoded formats return the raw PDF file content in a transport-friendly encoding. Useful when you need the original file rather than extracted text - for example to archive an attachment PDF that was captured by the headless browser.
Base64
format: "base64"The raw PDF file content encoded as a Base64 string. Useful when you need the original PDF bytes embedded in a JSON payload or email.
JVBERi0xLjQKMSAwIG9iago8PAov
VHlwZSAvQ2F0YWxvZwovUGFnZXMg
MiAwIFIKPj4KZW5kb2JqCjIgMCAo...Common use cases
- Embedding PDFs in API responses
- Email attachments
- Systems that require Base64 input
Binary
format: "binary"The raw PDF file bytes, exactly as fetched. The result URL serves the original PDF as a binary download; inline delivery base64-encodes it with contentEncoding: "base64".
(Binary PDF data - download via the presigned result URL)Common use cases
- PDF archival and storage
- Re-serving downloaded attachment PDFs
- Proxying PDFs through your own system
Image Formats
Image formats render a single page - the first page of the PDF, or the first page in your pages selection - as a raster image. Useful for previews and thumbnails. To get a different page, set pages to that page number.
PNG
format: "png"A rasterised image of the first page (or the first page in your pages selection) in PNG format. Lossless, best for documents with text. One image per request, not one per page.
(PNG image data - download via the presigned result URL)Common use cases
- Document thumbnails and cover previews
- Visual comparison and auditing
- Feeding a page image to your own OCR or vision model
JPG
format: "jpg"A rasterised image of the first page (or the first page in your pages selection) in JPEG format at quality 85. Smaller than PNG with lossy compression.
(JPEG image data - download via the presigned result URL)Common use cases
- Web thumbnails where file size matters
- Social media previews
- Quick visual previews
WebP
format: "webp"A rasterised image of the first page (or the first page in your pages selection) in WebP format at quality 85. Best balance of quality and file size for web display.
(WebP image data - download via the presigned result URL)Common use cases
- Web applications optimised for performance
- Mobile-friendly document previews
- Progressive web apps