Skip to main content

Guides

How to prepare documents for AI

How to extract documents into structured, citable text and Markdown that an AI can actually use.

By GistCite team, Product and engineering · For researchers and students, consultants and analysts, developers

Published · Reviewed

Key takeaways

  • Plain text copied by hand loses headings, tables and page numbers, so an AI has nothing to cite.
  • Document Extractor returns immediate plain text, then layout-aware Markdown with a page anchor before every page.
  • Tables export as CSV or XLSX instead of being retyped.
  • Scanned pages need OCR before they have any text to extract.
  • Clean the Markdown in the Markdown Editor before it goes to a summary or an API call.

Why raw copy-paste breaks AI

Text copied straight out of a PDF loses its headings, breaks mid-word at column edges, scrambles tables into a run of numbers, and carries no page numbers. An AI summary built on that text has nothing to cite; a scanned page has no text at all to copy.

A table with merged cells or multi-line headers is especially prone to this: numbers end up in the wrong row entirely, which is worse than losing formatting because it can look correct until someone checks it against the original.

Get text with structure, not just characters

Document Extractor returns plain text immediately using pypdf, then a layout-aware Markdown version shortly after, built with Docling. Every page gets a page anchor, headings form a clickable outline, and tables are detected so they can be exported as CSV or XLSX instead of retyped.

This two-step return, plain text first and Markdown a moment later, means a workflow does not have to wait on the slower, more thorough pass before it can start reading or searching the document.

Handle scans before anything else

A scanned or photographed page has no text layer, so extraction alone returns nothing for it. OCR recognizes those pages at 3 units each on Pro and API; the free plan reads only pages that already carry a text layer.

Because OCR is priced and run separately, a document with only a few scanned pages does not pay the OCR rate for the pages that already had a text layer.

Polish before it goes to an AI

Open the extracted Markdown in the Markdown Editor to fix a heading, clean a table or add a diagram, with live preview and nothing uploaded. Export the cleaned version as Markdown, DOCX or HTML once it is ready.

Feed it to the rest of the toolkit

The same extracted text can be summarized, questioned with citations, translated, or chunked into RAG-ready JSON with offsets for a vector store, all from the same document without extracting it twice.

The Document Extractor's REST API returns the same plain text, Markdown, tables and chunked JSON, so a pipeline can run the identical extraction on every new file without touching the browser.

Questions

Which file types work?
PDF, DOCX, PPTX, XLSX, TXT, Markdown, EPUB and HTML, uploaded or fetched from a link.
Does it handle scanned PDFs?
Yes on Pro and API, at 3 units a page for OCR. The free plan reads the existing text layer only.

References

The tools this article uses

Document Extractor

Extract clean text and LLM-ready Markdown from PDF, DOCX, PPTX, XLSX, TXT, EPUB and HTML, with OCR for scans, then export in nine formats.

About Document Extractor

Markdown Editor

Write, edit and preview Markdown live, open a document extraction to polish it, and download .md, DOCX or HTML; nothing leaves the browser.

About Markdown Editor

AI Summary, Ask and Create

Summarize any source into an overview, key points and timestamped chapters; ask questions with citations; create posts, briefs and scripts from it.

About AI Summary, Ask and Create

Put it into practice

The step this article describes is one action in the toolkit.