Skip to Content

File formats

Which formats each operation accepts and how Papyrus detects them

Papyrus detects the format of every document from its content, then checks it against what the operation accepts. This page lists both.

By operation

FormatExtensionsMarkdownMarkdown with OCRRender and thumbnail
PDF.pdfyes, text layer onlyevery pageyes
Word.docx, .doc, .rtfyesevery pageyes, through LibreOffice
PowerPoint.pptx, .pptyes, slide text, tables and notesevery slide, without notesyes, through LibreOffice
Excel.xlsx, .xlsyes, one table per sheetas textyes, through LibreOffice
OpenDocument.odt, .odp, .odsyesevery page; .ods as textyes, through LibreOffice
Outlook.msgyes, headers and bodyas textno
HTML.html, .htmyesas textyes; thumbnails are browser captures
EPUB.epubyesas textno
CSV and TSV.csv, .tsvyes, as a tableas textno
Jupyter.ipynbyesas textno
RSS and Atom.rss, .atom, .xmlyesas textno
JSON.json, .jsonlyes, passed throughas textno
ZIP.zipyes, every entry convertedas textno
Text and Markdown.txt, .md, …yes, passed throughas textno
Code and config.py, .ts, .go, .sql, .yaml, …yes, as one fenced blockas textno
Images.png, .jpg, .webp, .gif, .bmp, .tiff, .avifnoyes; every frame of a TIFF, the first frame of othersyes

"As text" means that OCR has no effect on the format: auto and ocr extract it as text mode does, and options.readMode in the response says so.

Screenshot takes http(s):// URLs only and captures whatever the browser shows.

A format an operation does not accept fails with 415 unsupported_format before conversion starts. A file that is corrupt or encrypted usually fails with the same code, once Papyrus tries to open it.

What to expect per format

  • Scanned PDFs have no text layer. The default readMode: auto reads their page images with a vision model when the server has one configured; without one they return little or no text.
  • Legacy and OpenDocument files (.doc, .ppt, .rtf, .odt, .odp, .ods) are converted with LibreOffice before Markdown extraction, which adds time to every request.
  • Office files and HTML in render and thumbnail, .docx, .pptx and .xlsx included, are exported by LibreOffice one page at a time, so source.pageCount is not reported. HTML thumbnails are the exception: they are browser captures.
  • HTML keeps headings, lists, links and tables. Site navigation and footers come through as text, as on the page.
  • Animated and multi-page images (GIF, TIFF, animated WebP) render one frame per request, chosen with page. OCR reads every frame of a TIFF and the first frame of the others.

How detection works

Papyrus identifies the content with Magika, a file type model, and uses the extension only to refine generic results. A PDF named report.docx is processed as a PDF; a .csv file is processed as CSV even though its content is plain text.

source reports the result:

FieldExampleMeaning
mimeTypeapplication/pdfMIME type of the detected format
extensionpdfCanonical extension, without the dot
labelpdfFormat label; for code, the language (python, sql)
groupdocumentFamily: document, spreadsheet, presentation, email, archive, markup, data, code, text, image or unknown

Use group to route documents in your own pipeline, and label when you need the exact format.

Check a file before processing

Inspect returns these fields and checks the name against the content, without processing the document.

On this page