trolls.dev

The Night Shift · Department

Preflight

Building a macOS utility that checks PDFs against submission limits and creates optimized copies while preserving the originals.

8 essays filed here

  1. 01

    Almost every 'compress your PDF' tool writes the smaller file back over the one you fed it, and it does this at the exact moment you can least afford it: the twenty minutes before a deadline, when the file that's over the limit is also the only good copy you have. One click later the master is gone and the diminished version is wearing its name. Preflight refuses to work that way. It never touches the file you picked — it builds the optimized copy off to the side, verifies it, and lands it under a new name with an atomic rename, so the original stays bit-for-bit intact and the undo is always the file you started with.

    6 min read
  2. 02

    You designed the whole thing on US Letter, so you think of the file as a Letter document. But a PDF has no single size — every page carries its own dimensions, and a submission gate measures all of them, not the one you're looking at. The page that fails is almost always one you never opened: an A4 export the template slipped in, a landscape exhibit, a scan at some odd millimetre. It looked uniform because page one was, and page one is what you saw. Preflight measures the file the way the gate does — every page's box, against the exact size required — names the outlier down to the millimetre, and, if the file is yours, fits it back to size without ever touching the original.

    6 min read
  3. 03

    A PDF is supposed to look the same everywhere — but that promise only holds if the fonts ride inside the file. When a typeface isn't embedded, the reader's machine substitutes its nearest guess, and the substitute is almost never the same width. The text reflows, a line runs long, a paragraph spills onto a page that wasn't there, and the layout you approved arrives subtly broken. It looked right on your Mac because your Mac had the font. Preflight is built to catch the letters that stayed home — it reads the font dictionary, names every face that isn't embedded, and, if the file is yours, welds them in before it flies.

    6 min read
  4. 04

    The portal says 'no more than ten pages,' and yours comes back rejected at twelve — even though you wrote exactly ten. A page limit isn't a byte limit: there's no slider that squeezes twelve pages down to ten, and the pages that put you over are almost always ones you never tallied — a cover sheet the template prepended, a signature page a tool appended, a blank verso your export left behind. Preflight counts the file the way the gate does, before the gate does: it reads the real page count, tells you exactly how many over you are, marks the blank pages that are safe to drop, and never touches the original — so the page you didn't count doesn't cost you the whole submission.

    6 min read
  5. 05

    You never typed a password, but the submission portal calls your PDF 'secured' and turns it away. The lock was there before you touched the file — set by a scanner, an export preset, or a download you forgot was protected — and it lives in a dictionary your reader honors silently, so the file opens fine and looks done while quietly refusing to be read by anything automatic. Preflight reads that dictionary before the gate does: it names the lock, tells you exactly what it forbids, and — if the file is yours — hands you a clean copy while leaving the original untouched.

    6 min read
  6. 06

    Every compressor you've ever used returns a smaller file, and smaller feels like success — so nobody checks what the bytes came off of. They come off the parts that made it a document: the selectable text flattened to a picture, the crisp vectors rasterized, the trim box nudged a hair. You find out at the far end, when someone can't select a word or the print shop finds the page moved. Preflight treats a pass that breaks one of those seals as a failure, not a win. If it can't hit the target while keeping the text selectable, the geometry exact, and the result independently verifiable, it refuses — and hands you back your untouched original instead of a smaller file that's quietly ruined.

    6 min read
  7. 07

    Two PDFs sit side by side on your screen, pixel for pixel identical. One is a real document; the other is a photograph of one. You can't tell them apart by looking — until you press Cmd+A and one of them selects nothing at all. That gap between what a page looks like and what's actually under it is where filings get bounced, citations go missing, and a finished document quietly fails a requirement no one showed you. Preflight reads the layer, not the picture.

    6 min read
  8. 08

    You finish the document, you go to submit it, and a box you never think about turns you away: the file is 5.31 MB and the limit is 5.00. All the work is done and the last obstacle is arithmetic. The reason it stings is that the upload form deals in exact bytes while every tool you reach for deals in vibes — 'compress,' 'reduce size,' a hopeful slider. Preflight is built to close that gap: it measures the file against the exact ceiling, builds a copy that provably fits, and never once touches the original.

    6 min read