P→MPDFMDSystem documentation
Format referenceOpen converter ↗

Level 2 · System flow

From PDF input to a document record

The conversion route preserves observations before interpretation. It then builds semantic candidates, writes PDFMD, parses the result again, validates it, and only then renders Markdown.

Canonical PDFMD sits between recognition and rendering

Figure 2 · Data flow
PDFsource bytes
→
Evidence bundleobservations
→
Semantic draftassertions + alternatives
→
PDFMDcanonical record
→
Markdownderived view

Markdown is never reparsed to recover the canonical record. The renderer consumes PDFMD and its package assets directly.

Eight processing stages

00

Check source and record run facts

Hash bytes; enforce file and page limits; inspect encryption, boxes, rotation, and damage; record tools and options.

Code
01

Collect observations

Capture native glyphs, OCR tokens, layout boxes, paths, annotations, and images in normalized page coordinates.

Code
02

Propose lines, columns, and order

Group baselines and score reading-order candidates using geometry and local continuity.

Partial
03

Identify page furniture and number systems

Use recurrence and sequence evidence so headers and footers do not become body text.

Partial
04

Resolve inline appearance

Attach bold, italic, decoration, scripts, color, and highlights to text runs.

Partial
05

Propose page-local structure

Headings, paragraphs, lists, quotations, notes, tables, and graphics.

Partial
06

Resolve cross-page structure

Join paragraph, list-item, footnote, and table fragments across page events.

Developing
07

Emit, reparse, validate, render

Write PDFMD, parse it, validate references and assets, then generate the human view.

Code

Native text and scanned text

Native PDF

Decoded glyphs, text matrices, baselines, fonts, paint operations, paths, and annotations are direct observations. OCR may remain as disagreement evidence but cannot replace good native text without a recorded reason.

Scanned or raster region

The page or selected image region is rendered at a recorded resolution. Tesseract supplies tokens and boxes. Missing OCR remains an explicit issue, and the raster asset is retained rather than silently dropped.

Implemented route; incomplete recognition scope

The capture → OCR → semantic draft → PDFMD → parse → validate → Markdown route is implemented. Recognition methods exist for the main element classes, but their accepted reliability differs. Complete paragraph assembly, exact scanned-font identification, a general resolver, model routing, and interactive review remain incomplete or planned.

Do not equate “valid” with “correct.” Format validation proves that the PDFMD structure obeys its contract. Source fidelity requires independent expected results or full page-by-page review.