PDF to Web: benefits
Freedom for PDFs
- 1
Navigation
Section sidebar, stable URLs
- 2
Search
“fair use” across all 24 chapters
- 3
Performance
287 KB page vs. 23.6 MB PDF
- 4
Accessibility
Headings, reflow, 12 languages
How: Regex to LLMs
One-shot conversion
- 1
Extract the text layer
Modern PDFs embed text. The structure still has to be parsed into XHTML.
- 2
LLM writes structured XHTML
LLMs are built on transformers, which model structure across a whole chapter.
- 3
Deterministic quality checks
Programs diff the PDF text against the HTML to confirm fidelity.
2012–2024
Regex + NLP
r'^SEC\. (\d+)\.'
Rules per edge case: BillMap, House Comparative Prints
↓
2026
LLM + QA
<section id="sec-101-1">
One pass per chapter, then QA
Examples
Same text, two formats
Copyright Compendium
1,396-page PDF
Commonwealth Drafting Manual
189-page PDF
Statutes at Large
Scanned volumes 1–125
Web
compendium.adhocteam.usaih.github.io/ commonwealth-leg-drafting-manualstatutes.linkedlegislation.org