Case Study: See how Formable built DOCX redlining with Apryse in two months

Document Parsing: What It Is and What It Returns

Document parsing starts with deterministic structure recovery. Purpose-built AI interprets the result afterward. Apryse Smart Data Extraction returns the recovered structure as JSON, table data or Markdown. This page shows what each format returns from one source document. It is part of document extraction and parsing.

What Is Document Parsing?

Document parsing recovers a file's structure and geometry deterministically: where each heading, paragraph, list, table, header and footer sits on the page, and in what reading order. Extraction comes after parsing. It interprets what the recovered content means, such as which value is an invoice total or which pages form a contract. That interpretation layer uses purpose-built AI and is probabilistic by design, so key-value pairs, form fields and classification results each carry a confidence score. OCR is a separate step. It generates a text layer for scanned pages that have none, and parsing reads that text. In the Apryse Server SDK, the Smart Data Extraction add-on returns parsed structure as JSON with page numbers and bounding boxes, table data or Markdown.

The rest of this page works through that distinction with one source document. The sequence is parse first, interpret second. The output format you pick decides what your next job can do with the result.

Parsing Versus Extraction Versus Structure Recovery

Copied to clipboard

Three terms get used interchangeably, and they name different layers. Document structure recovery is the deterministic foundation. It works out where every block sits on the page and what role each block plays. Parsing and extraction both depend on it.

Term
What It Does
What It Returns
When You Need It
Structure recovery
Recovers document geometry and reading order deterministically. Identifies each block as a header, footer, paragraph, list, image or table.
Logical structure with page positions.
Always. Parsing and extraction both start here.
Parsing
Returns the recovered structure in the format you choose.
JSON with page numbers and bounding boxes, table data or Markdown.
When the next job needs layout, order or table cells, not a flat string.
Extraction
Interprets what the recovered content means. Answers vary by document, so each result carries a confidence score.
Key-value pairs, detected form fields and page categories, each with a confidence score.
When you need the value behind a label or the type of a page, not the layout.

Interpretation is where key-value extraction sits. Your application decides what happens to a low-confidence result, because the score is an input to your logic, not a verdict. Table results are the exception: they do not include a confidence score.

OCR belongs to neither layer. It generates a text layer where a page has none, and parsing reads the text a page already has.

Where Parsing Sits in the Pipeline

Copied to clipboard

Parsing runs after OCR and before interpretation. A scanned page gets its text layer first. Structure recovery and parsing return the layout. Extraction then reads that layout for meaning. Four stages result, and only the first three are document work:

OCR:
Copied to clipboard

When the page is image-based. Smart Data Extraction runs a built-in OCR step before it recovers structure.

Structure recovery and parsing:
Copied to clipboard

Smart Data Extraction returns the layout in your chosen format.

Extraction:
Copied to clipboard

Smart Data Extraction returns key-value pairs, form fields or page classifications, each with a confidence score.

Your application:
Copied to clipboard

Validation, routing, storage and review belong to your code.

Apryse supplies the building blocks for stages one through three. Your team owns the pipeline around them. The Server SDK provides no work queue, job scheduler or batch orchestration, so you write the loop that feeds documents in and acts on what comes out. Each stage runs inside your own infrastructure, which means no document content leaves your environment. For the pipeline view in blog form, read document parsing and data extraction.

What You Get Back

Copied to clipboard

Smart Data Extraction returns four output formats from the same source document. Every sample below comes from one file, run through the Server SDK. Call PDFNet.initialize() before any extraction operation. The DataExtractionTest sample ships in the main SDK download, and the workflow guide covers setup and options.

Each output is one call against the same source file. Python shows the pattern, and the other Server SDK languages follow the same shape.

Source File

Copied to clipboard

Source PDF Document

SDK Outputs

The below are samples of the outputs for the above PDF document, stopping at “Widget B” in the PDF table.

JSON With Coordinates

Copied to clipboard

JSON is the output for work that needs to know where things are. It carries page numbers and bounding boxes, so your application can place an overlay or an annotation on the source page, route content by position or feed a compliance check. The JSON specification documents every field.

Tables to JSON or Excel

Copied to clipboard

Table extraction finds the tables in a PDF, including merged cells and multi-row headers, and exports them to JSON or Excel. Table results do not include a confidence score. Whole-document PDF to XLSX conversion is a different add-on, the Structured Output Module. The Excel export on this page covers the tables Smart Data Extraction finds, not the whole document.

Table output in .XLSX format

Markdown for AI and RAG Pipelines

Copied to clipboard

Markdown output is generated from the StructuredOutput document structure, not from flat text extraction. That mechanism is why headings, lists, tables and reading order carry through. The output keeps paragraphs in reading order, heading levels 1 to 6, nested bulleted and numbered lists, tables with headers and merged cells, images with alt text, links and bookmark anchors. Nested tables come through as inline HTML. For image-based PDFs, hidden text is reprocessed with OCR before export.

Markdown is data for a pipeline, not a visual copy of the page. It is the RAG-ready format, and extraction for RAG and LLM pipelines makes that argument in full. Markdown output runs on Windows and Linux in every supported SDK language and is included in your existing Smart Data Extraction add-on license. For an editable DOCX, XLSX, PPTX or HTML copy of the whole document, use the Structured Output Module, which does not output Markdown.

Choosing an Output Format for the Job

Copied to clipboard

Pick the format by what your next job does with the document, not by which is easiest to produce. The formats are not exclusive. Run the same source file through two of them when two jobs need it, such as JSON for a review overlay and Markdown for a model.

Downstream Job
Output Format
Why It Fits
Place an overlay or annotation on the source page, or route content by position
JSON with page numbers and bounding boxes
Carries the geometry your viewer or router needs.
Load table data into a spreadsheet or an analytics job
Table output as JSON or Excel
Returns cells as data, including merged cells and multi-row headers.
Feed an AI, RAG or LLM pipeline
Markdown
Keeps headings, lists, tables and reading order in a plain text format.
Produce an editable Word, Excel, PowerPoint or HTML copy of the whole document
Not Smart Data Extraction. Use the Structured Output Module.
Converts the whole PDF to DOCX, XLSX, PPTX or HTML as a separate add-on.

What Breaks When Parsing Is Skipped

Copied to clipboard

Flattening a document to a string drops information the page carried. Text extraction is the right tool when you need the words. When your next step depends on layout, three failures show up, and none of them appears in an error log.

Failure
What Happens in Your Pipeline
What Parsing Supplies
Lost reading order
Page headers, footers and captions land in the middle of body paragraphs, and a sidebar interrupts the sentence beside it.
Reading order recovered from page geometry.
Merged columns
Text from two columns reads as one stream, so sentences interleave. Table columns collapse into a run of values with no headers attached.
Column and table structure with headers and merged cells.
Broken chunk boundaries
A fixed-size chunker splits a table midway or separates a heading from its paragraph. One chunk holds half a table, and another holds text with no heading.
Headings, lists and tables as discrete elements to split on.

Without that structure, the output still looks like text. The damage surfaces later as a wrong answer from a model or a value filed under the wrong label.

Setup, Licensing, and Platform Support

Copied to clipboard

Smart Data Extraction is a Server SDK add-on module. The table lists what you need before the first call.

Fact
Apryse Server SDK with Smart Data Extraction
Where it runs
Your own infrastructure: an on-premises server, a cloud VM or a container. Document content stays in your environment.
Operating systems
Windows and Linux, x64 only. macOS is not supported. ARM and 32-bit platforms are not supported.
Required gate
Call PDFNet.initialize() before any extraction operation.
SDK version
Markdown output requires Apryse SDK 12.0 or later.
OCR for scanned pages
Image-based pages go through the module's built-in OCR step. For document structure and Markdown output you choose between a default engine and a Paddle engine, and you set the OCR language. The separate OCR Module is a different add-on.
Licensing
Smart Data Extraction needs its own add-on license. Markdown output is included in that license. Trial keys have unlimited access. Trial output is capped at 100 pages and may include an evaluation watermark page.
Install
Node.js: npm install @pdftron/data-extraction. Python: pip install --extra-index-url=https://pypi.apryse.com apryse-data-extraction. Java: add the DataExtractionModuleWindows or DataExtractionModuleLinux Maven dependency (group ID com.pdftron). C++: expand the archive into the SDK directory.
Get-started guides
Node.js, Python, Java, C++
Sample
The DataExtractionTest sample ships in the main SDK download.
Documentation
Smart Data Extraction overview, setup and workflow, document structure and tabular data
What the SDK does not do
Batch processing, work queues and job orchestration are your application's job.

Frequently Asked Questions

No. Parsing recovers a document's structure and geometry, and extraction interprets what the recovered content means. Parsing sits on a deterministic structure foundation and returns layout in the format you choose. Extraction uses purpose-built AI to return key-value pairs, form fields or page classifications, each with a confidence score. Run parsing first, because extraction reads the structure that parsing recovers.

Smart Data Extraction returns four from the same source document: JSON with page numbers and bounding boxes, table output as JSON or Excel, and Markdown. JSON suits overlays and routing, table output suits spreadsheets and analytics, and Markdown suits AI and RAG ingestion. Whole-document conversion to DOCX, XLSX, PPTX or HTML is the Structured Output Module, a separate add-on.

Yes. Run the same source file through the Markdown conversion and through the JSON output. Markdown is generated from the StructuredOutput document structure, so headings, lists, tables and reading order carry through, while JSON adds page numbers and bounding boxes for overlays. Markdown output needs Apryse SDK 12.0 or later and is included in your existing Smart Data Extraction add-on license.

Only when the page has no text layer. A scanned or image-based page has no text for parsing to read until OCR generates it, and Smart Data Extraction runs a built-in OCR step for those pages before it recovers structure. You pick the OCR engine for document structure and Markdown output, and you set the OCR language. The separate OCR Module is a different add-on, for searchable PDFs and OCR text with position data.

Reading order, structural roles and table relationships. A flat string cannot tell a heading from a caption, so a chunker has no boundary to respect and two-column pages interleave. Table cells lose the headers that gave their values meaning. Parsing keeps that structure and returns it as JSON, XML, table data or Markdown.

Try It on Your Own Documents

Run one of your own PDFs through Smart Data Extraction and compare the four outputs side by side.