How we test Lamina PDF
Every night, Lamina PDF reads thousands of difficult PDFs and compares what it finds with other PDF tools. This page shows the latest night's results and what each number counts. It also states the licence and how the code is written.
The latest night ran on and tested version 0.9.0, commit d29966a. Every check passed that night.
13 of the last 24 nights passed every check, counting from .
Files that break PDF readers
The files come from the test suites of four other PDF projects: pdf.js, PDFBox, PDFium and qpdf. Many of their files once broke a reader: they are damaged, unusual or built to attack one. Lamina PDF also reads deliberately damaged copies of its own test files.
| Files from | Files | Opened | Repaired | Refused | Refused, another tool opened it |
|---|---|---|---|---|---|
| pdf.js | 1,013 | 83.7% | 14.6% | 1.7% | 6 |
| PDFBox | 175 | 92.0% | 2.9% | 5.1% | 0 |
| PDFium | 345 | 79.1% | 12.2% | 8.7% | 9 |
| qpdf | 639 | 85.1% | 7.7% | 7.2% | 13 |
| Lamina PDF's own files, damaged on purpose | 4,018 | 18.6% | 72.1% | 9.4% | 99 |
Opened means Lamina PDF read the file's structure and its list of pages. It doesn't mean every page was drawn correctly. Repaired means it fixed broken structure first, as other readers do. Refused means it stopped with an error; the last column counts the refused files that at least one other tool opened.
No file made Lamina PDF crash, hang or panic.
Agreement with other PDF tools
For every file, Lamina PDF and four other tools (pdf.js, PDFium, qpdf and pypdf) each report three facts: whether the file opens, how many pages it has, and the titles in its outline. Each percentage counts the files where both tools report the fact and give the same answer.
| Tool | Opens or not | Page count | Outline titles |
|---|---|---|---|
| pdf.js pdfjs-dist 6.4.299 | 82.5% | 96.0% | 99.6% |
| PDFium pypdfium2 5.14.0, PDFium 156.0.8076.0 | 83.0% | 94.9% | 99.5% |
| qpdf qpdf version 12.4.2 | 85.0% | 98.5% | 99.7% |
| pypdf 6.21.3 | 73.3% | 95.9% | 99.5% |
A different answer isn't always Lamina PDF's mistake: tools disagree about damaged files. We examine each kind of difference and list the explained ones in the repository, each with its reason. A difference nobody has explained fails the night.
No difference was left unexplained.
Lamina PDF also compares each page's text with pdf.js's and pdftotext's, ignoring spaces. A page agrees when Lamina PDF's text matches either tool's.
| Files from | Pages compared | Pages that agree |
|---|---|---|
| pdf.js | 1,889 | 61.8% |
| PDFBox | 308 | 85.4% |
| PDFium | 378 | 90.5% |
| qpdf | 3,603 | 96.7% |
Fuzzing: machine-made inputs that try to crash it
A fuzzer feeds the code machine-made inputs, millions a night, and keeps any that make it crash. Each target is one part of Lamina PDF, such as the parser or text extraction.
29 targets ran for 10 minutes each and tried 115,241,098 inputs. None found a crash.
Over every recorded night, the fuzzers have run for at least 147 hours in all.
Saved files that other tools read back
Lamina PDF edits and saves each of its test files in every way it can, then qpdf, pdf.js and PDFium open every saved file.
Of 10518 cases, 8785 were saved. Lamina PDF refused the other 1733, as the tests expect: it refuses a save that would break a signature or that the file can't take.
- pdf.js read every saved file without an error.
- PDFium read every saved file without an error.
- qpdf read every saved file without an error.
The same example programs, run in each JavaScript runtime and in Rust, must write the same bytes.
Matched byte for byte: Node.js, Chromium, Firefox, Deno, Bun, Cloudflare Workers, WebKit (Safari).
PDF/A and PDF/UA
veraPDF, the reference checker for the archive (PDF/A) and accessibility (PDF/UA) standards, checks each example that claims one of them.
| Example | Standard | veraPDF's verdict |
|---|---|---|
edit_xmp.pdf | PDF/A-2b | Passes |
pdf_a_archive-2b.pdf | PDF/A-2b | Passes |
pdfa-form-filled.pdf | PDF/A-2b | Passes |
pdfa-form-sanitised.pdf | PDF/A-2b | Passes |
add_page_marks.pdf | PDF/A-2u | Passes |
edit_metadata-pdfa.pdf | PDF/A-2u | Passes |
pdf_a_archive-2u.pdf | PDF/A-2u | Passes |
attach_factur_x.pdf | PDF/A-3b | Passes |
pdf_a3_invoice_with_xml.pdf | PDF/A-3b | Passes |
add_links-pdfua.pdf | PDF/UA-1 | Passes |
add_page_marks.pdf | PDF/UA-1 | Passes |
comment_summary-review-list.pdf | PDF/UA-1 | Passes |
comment_summary-review.pdf | PDF/UA-1 | Passes |
comment_summary.pdf | PDF/UA-1 | Passes |
create_contents_page-pdfua.pdf | PDF/UA-1 | Passes |
edit_metadata-pdfa.pdf | PDF/UA-1 | Passes |
edit_tagged_pdf.pdf | PDF/UA-1 | Passes |
flowing_invoice.pdf | PDF/UA-1 | Passes |
flowing_report.pdf | PDF/UA-1 | Passes |
invoice_from_json.pdf | PDF/UA-1 | Passes |
mark_up-pdfua.pdf | PDF/UA-1 | Passes |
markdown_to_pdf.pdf | PDF/UA-1 | Passes |
pdf_a_archive-2u.pdf | PDF/UA-1 | Passes |
pdf_ua_report.pdf | PDF/UA-1 | Passes |
Drawing pages: hayro and PDFium
The web reader draws pages with PDFium, the renderer in Chrome. Lamina PDF also has hayro, a renderer written in Rust, which may replace PDFium once it draws pages as well as PDFium does. Each night both draw the first 20 pages of every file, and the comparison counts the pages that look the same or nearly the same.
92.2% of 5,108 pages look the same or nearly the same.
| Files from | Pages | Same or nearly the same |
|---|---|---|
| pdf.js | 1,472 | 90.6% |
| PDFBox | 309 | 93.9% |
| PDFium | 422 | 78.0% |
| qpdf | 2,905 | 94.9% |
| All files | 5,108 | 92.2% |
What these figures leave out
- The files are chosen because they are difficult. They aren't a sample of the PDFs people use every day, so the share opened is not how often an everyday file opens.
- Agreeing with other tools is not the same as being right: when every tool is wrong in the same way, Lamina PDF agrees with them.
- Opening a file and reading its pages doesn't prove every page is drawn or extracted correctly.
- Only nights that ran their full budgets are recorded. A night cut short, such as one whose fuzzing stopped early, records no figures, so it doesn't count among the nights above.
- Speed and size are measured elsewhere, on the docs site's Benchmarks page.
The licence
Lamina PDF is open source, under MIT OR Apache-2.0: you may use it in open or closed software, and choose either licence.
Every dependency must be under one of these licences:
MITApache-2.0Apache-2.0 WITH LLVM-exceptionBSD-2-ClauseBSD-3-ClauseISCZlib0BSDUnicode-3.0BSL-1.0CC0-1.0
A few named dependencies may use another licence:
MPL-2.0, foruniffi,uniffi_bindgen,uniffi_core,uniffi_internal_macros,uniffi_macros,uniffi_meta,uniffi_pipeline,uniffi_udl,selectors,cssparser,cssparser-macros,dtoa-short,option-extMIT-0, forborrow-or-shareIJG, forjpeg-encoderCDLA-Permissive-2.0, forwebpki-root-certs
These are refused whatever licence they claim:
mupdf: AGPL-3.0 (ADR 0001, ADR 0019)mupdf-sys: AGPL-3.0 (ADR 0001, ADR 0019)
Every change runs cargo-deny and an npm licence check before it can merge. Those checks cover dependencies, not copied code. No tool can prove that code wasn't copied, so the next section says how the code is written.
veraPDF, which is under the GPL and MPL, runs only as a separate program in the tests. It is never part of what Lamina PDF ships.
How the code is written
Lamina PDF's own Rust code reads, edits and saves PDFs, written from the PDF standard (ISO 32000-2) and the standards it cites. For fonts, text shaping and writing page content, it uses open-source libraries such as skrifa, HarfRust and pdf-writer, each under one of the licences listed above.
AI coding agents write most of the code, Claude Code above all. Each of their commits says so in its message, so anyone can count them. The project's owner decides what gets built and in what order.
Every change starts from a written plan in the repository and arrives as a pull request with its tests. An automated code review reads it, and a person reviews it before it merges. It merges only when its checks pass: the tests, plus shorter runs of the comparisons, fuzzing and saved-file checks on this page.
The full checks on this page run every night. They don't hold up a merge, but they do hold up a release: a version goes out only after a full nightly run passes on its commit or an earlier one.