Dev.to WebDev πŸ›  Dev πŸ‘ 0 πŸ“– 1 min read

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:

  1. Trim Size, Bleed & Spine Width Validation: Supports 13 standard trim sizes across KDP Paperback, KDP Hardcover (case laminate), and IngramSpark Paperback.
  2. Automated Safe-Zone Collision Detection: Reads text item bounding boxes via pdf.js and flags text colliding with the ISBN barcode zone, inner gutter, outer margins, hinge, or spine.
  3. 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.
  4. Interactive Visual Overlay: Draws exact bleed, trim, safe margin, spine, and barcode guides directly on top of rendered PDF pages.
  5. 300 DPI Cover Template Generator: Generates exact-dimension PNG + vector PDF templates in the browser using pdf-lib.

Useful guides included

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!

πŸ“° Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.