docling-project / docling-project/docling

Discussion: standard profile for embedding reusable parsed-document data in PDF

Open
#4,123 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
66.4k
Forks
4.8k
Avg merge
3d 4h
Merged PRs (30d)
98

Description

## Question / proposal

Is Docling interested in a vendor-neutral profile for embedding a versioned `DoclingDocument` JSON representation in the source PDF, so later consumers can load it instead of repeating PDF parsing, layout inference, and OCR?

PDF 2.0 Associated Files and PDF/A-4f already provide a plausible container. A minimal interoperability profile could define:

- the embedded file media type and schema/version discovery;
- `/AFRelationship` (for example `/Supplement` or `/Alternative`);
- page/region anchoring and coverage;
- parser/model provenance and confidence;
- a hash or binding to the source PDF revision;
- validation and fallback rules when the representation is missing, stale, or unsupported.

Docling's lossless, versioned `DoclingDocument` JSON looks like a strong concrete implementation target. I found two encouraging adjacent efforts:

- #3567, support for PDF/A-3u files carrying canonical Markdown;
- #4081, preferring embedded MathML/associated files over reconstructing equations.

Those solve specific payloads. The broader gap seems to be a generic, vendor-neutral “parsed representation present” contract that other libraries and document-AI vendors could also implement.

### Questions

1. Is anything like this already planned or discussed in Docling?
2. Would maintainers accept an experimental reader/writer profile for embedded `DoclingDocument` JSON?
3. Would the project be interested in taking the profile to the PDF Association's [PDF Reuse TWG](https://pdfa.org/community/pdf-reuse-twg/) and coordinating with formats such as ALTO/PAGE rather than making it Docling-specific?

The goal is not to bless untrusted extracted data blindly; it is to make a declared representation discoverable and verifiable, with a clear fallback to normal parsing/OCR.

Contributor guide

Open the contributing guide

Research direction

No files or tests are named. Start by reviewing the related work in #3567 and #4081, then confirm with maintainers whether an experimental reader/writer profile is wanted. Done would require an agreed scope for the profile, its validation and fallback rules, and an implementation plan.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.