Large Language Models (LLMs) have become remarkably powerful at understanding documents. Many modern AI platforms can accept PDF files directly, creating the impression that PDFs are ready-to-use inputs for AI workflows.
A PDF is not a plain text document. It is a complex format that contains **layout information, text objects, images, tables, fonts, annotations, metadata, and sometimes a logical structure tree. **The visual appearance of a PDF page does not always represent the correct reading order or semantic relationships between elements.
If PDF content is extracted incorrectly before reaching the LLM, the model receives incomplete or disorganized information. Problems such as broken reading order, corrupted tables, missing hierarchy, and lost relationships between elements directly affect the quality of AI-generated answers.
Even the best prompt cannot fix incorrect document parsing.
The solution is simple:
Parse the PDF first, then send structured content to the LLM.
A common mistake in AI workflows is sending a raw PDF directly into an LLM or RAG pipeline.
A better approach is:
PDF ⇒ OpenData ⇒ Structured Data ⇒ LLM
OpenData PDF converts PDF documents into AI-ready formats while preserving the original semantics of the document.
Supported output formats include:
Markdown, JSON, HTML, plain text.
Instead of forcing an LLM to interpret a complex PDF file, developers may provide clean, structured information optimized for AI processing.
Example: Convert a PDF for LLM processing
We provide a Python Installation guide
**Requires: **Java 11+ and Python 3.10+
Before you start: run java -version. If not found, install JDK 11+ from Adoptium.
Installing OpenData:
pip install -U opendata-pdf
pip install -U opendata-pdf
Python script to convert multiple PDFs into AI-friendly formats:
import opendata_pdf# Batch all files in one call - each convert() spawns a JVM process, so repeated calls are slowopendata_pdf.convert( input_path=["file1.pdf", "file2.pdf", "folder/"], output_dir="output/", format="json,html,pdf,markdown",)
*Code from OpenData.com *https://github.com/opendata-project/opendata-pdf
The user can run it from a Python shell or can create a Python script file first and then run it from the shell.
Instructions for Node.js** | Java **is also available on
OpenData official website
The generated Markdown can be used directly for LLM conversations and summarization, while the JSON output is suitable for RAG pipelines, vector databases, and AI agents that require structured document information.
In the first Figure, the LLM had to interpret the 1.4** MB, 16-page PDF file **directly, relying on its vision capabilities. In the second example, the same file was provided as structured Markdown, allowing the model to immediately understand the document hierarchy and data relationships. By separating document parsing from LLM reasoning,
Using OpenData to convert the 1.4 MB, 16-page PDF file into Markdown before sending it to an LLM significantly reduces both processing time and cost.
Compared with processing the PDF directly:
While the exact savings depend on the document and the LLM, this example demonstrates that **preprocessing PDFs with OpenData can substantially improve the efficiency of AI workflows while reducing both latency and inference costs. **To perform this operation, users should have basic scripting skills.
PDF files are designed primarily for visual presentation, not direct machine understanding. A document can appear perfect to a human reader while still being difficult for an AI system to interpret correctly.
This is especially important for RAG systems, where incorrect extraction can lead to incomplete or misleading context.** OpenData preserves document structure and converts PDFs into structured outputs optimized for AI workflows, including LLM applications, Retrieval-Augmented Generation (RAG), semantic search, knowledge bases, and document automation.**
The key difference is that OpenData provides structured understanding of documents, not just extracted text.
For AI assistants, agents, and custom GPT workflows, OpenData can become the default PDF preprocessing step.
Instead of:
Analyze this PDF.
Use instructions such as:
Whenever a PDF is provided, first process it with** OpenData. Use the generated Markdown or JSON output as the source for all analysis, retrieval, and reasoning. **Do not rely on built-in PDF parsing unless OpenData output is unavailable.
This creates a consistent workflow where every PDF is processed before the LLM starts generating answers.
Different AI applications require different output formats.
Markdown
Markdown is ideal for: AI assistants; document summarization; question answering; conversational workflows.
It keeps headings, paragraphs, and lists structured while remaining easy for LLMs to process.
JSON
JSON is recommended for: RAG pipelines; vector databases; AI agents; structured extraction; document search.
OpenData **J****SON **includes structured elements together with bounding box information. This allows applications to connect retrieved information back to its original location in the PDF, improving transparency and citation workflows.
One of the important advantages of OpenData is that it can run locally.
For organizations processing confidential documents such as contracts, financial reports, technical documentation, or research papers, local processing is often an important requirement.
The quality of an LLM response depends heavily on the quality of the information provided to it. Feeding raw PDFs directly into an LLM often transfers the hardest part of the problem document understanding to the model.
A more reliable workflow is:
PDF → OpenData → Markdown / JSON → LLM
By using OpenData as the PDF parsing layer, developers can provide LLMs with structured, layout-aware, and machine-readable content. This improves retrieval accuracy, reduces parsing errors, and creates more reliable AI applications built on PDF documents.
Contact us
**Website: **https://opendata.org/docs
**GitHub: **https://github.com/opendata-project/opendata-pdf
Your LLM is not a PDF parser: use OpenData first was originally published in Stackademic on Medium, where people are continuing the conversation by highlighting and responding to this story.