Building a 100% Client-Side PDF Preflight Checker for Amazon KDP with pdf.js and pdf-lib
Self-published authors uploading print-ready PDFs to Amazon KDP or IngramSpark often hit frustrating rejection loops: bleed off by 0.125", text accidentally creeping into the back-cover ISBN barcode box, unembedded fonts
Self-published authors uploading print-ready PDFs to Amazon KDP or IngramSpark often hit frustrating rejection loops: bleed off by 0.125", text accidentally creeping into the back-cover ISBN barcode box, unembedded fonts, low-DPI images, or spine width mismatches.
Most existing preflight tools require uploading an unreleased manuscript to a third-party server or paywall basic print checks. I wanted to see how much real print preflighting could run 100% locally in the browser with zero file uploads.
You can try the live tool here (includes 2 built-in sample PDFs if you don't have a book PDF handy):
π PressCheck β Free KDP & IngramSpark PDF Preflight Checker
What runs locally in the browser
Built with Astro, React, pdf.js, and pdf-lib, deployed as a static site on Cloudflare Pages:
- Trim Size, Bleed & Spine Width Validation: Supports 13 standard trim sizes across KDP Paperback, KDP Hardcover (case laminate), and IngramSpark Paperback.
-
Automated Safe-Zone Collision Detection: Reads text item bounding boxes via
pdf.jsand flags text colliding with the ISBN barcode zone, inner gutter, outer margins, hinge, or spine. - Effective Image DPI & Print Checks: Walks PDF operator lists and CTM (Current Transformation Matrix) transforms to estimate effective image DPI, plus checks font embedding, transparency/SMask usage, and RGB/CMYK color spaces.
- Interactive Visual Overlay: Draws exact bleed, trim, safe margin, spine, and barcode guides directly on top of rendered PDF pages.
-
300 DPI Cover Template Generator: Generates exact-dimension PNG + vector PDF templates in the browser using
pdf-lib.
Useful guides included
- How to Fix KDP Bleed & Trim Size Errors
- KDP Spine Width Calculator & Formula Guide
- Free 6x9 KDP Cover Template
If you have ever fought with KDP or IngramSpark print rejectionsβor built browser-side PDF tooling with pdf.jsβI'd love to hear any edge cases or print specs you'd want checked!
Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.