Verify PDFs before switching¶
Choose a normal record, the largest expected input, a sparse record, and one with long names or multilingual text. Use the same data, fonts, images, time zone, and date formatting in both engines.
Compare content and pagination¶
Install Poppler, then capture the page counts and extracted text from both PDFs.
pdfinfo baseline.pdf | grep '^Pages:'
pdfinfo candidate.pdf | grep '^Pages:'
pdftotext -layout baseline.pdf baseline.txt
pdftotext -layout candidate.pdf candidate.txt
diff -u baseline.txt candidate.txt
Spacing differences can be expected. Review missing or reordered text, totals, page starts, repeated table headings, page numbers, and clipped footers. Open a short and a long candidate PDF to inspect the first, middle, and last pages.
Establish release criteria¶
- Run layout diagnostics for each fixture and resolve errors.
- Agree on which differences in whitespace and pagination are acceptable and keep one baseline per document family.
- Validate PDF profiles or signatures when your workflow requires them.
- Compare latency, CPU, and memory using the same input and deployment conditions.
- Keep the old renderer available while reviewing the first production outputs.
Keep the fixtures and checks in your application's tests so font or CSS changes have a baseline.