Loading…
Loading…
Editing that flows.
So I studied PDF libraries across languages, cataloged why they all fail at the same things, and wrote a layout engine from scratch to fix it.

I’m 31, I have two kids, and I’ve been writing code since I was 16. Fifteen years of full-stack development — backends, frontends, infrastructure, the kind of complex systems where at some point a client always says “and we need it to generate a PDF.” Moved from Ukraine to the US a few years ago, kept building.
The project that broke me: a client needed automated generation of multi-page financial reports. Complex layout — flex-based header, data tables that span pages with repeated headers, summary blocks that adjust depending on the data. Standard modern CSS that any browser renders in milliseconds.
No PDF library could handle it. I tried them across languages. Python’s WeasyPrint — the most capable one I found — still no Flexbox, and pagination broke on tables crossing page boundaries. ReportLab — powerful but no HTML/CSS pipeline, you position everything by hand. Java’s OpenHTMLtoPDF — archived. iText — commercial with aggressive licensing. PHP — CSS 2.1 engines from the mid-2000s with unpatched security holes. JavaScript — everything wraps Chromium, 300MB per process.
Same wall in every language: a CSS engine stuck in 2010, or a headless browser you can’t deploy at scale. I spent days on workarounds — absolute positioning instead of flex, manual page breaks, duplicating headers by hand. The output looked close enough, but the code was unmaintainable.
That night I didn’t close the project and move on. I opened the PDF specification and the source code of the libraries I’d been fighting with. Not searching for another tool. Trying to understand why they all fail at the same things.
“I wasn’t sure I could pull it off. A full CSS layout engine is years of work for a team. But I’d read the spec, I’d studied exactly where each library hit a wall, and I knew what not to do. Sometimes that’s enough to start.”
On the editing side — the same gap. Adobe Acrobat charges $23/month for overlay editing — text pasted on top of a frozen page. Smallpdf, Sejda, DocHub — all the same. None of them can reflow content.
I understand the scope of what I’m attempting. Going from positioned text to editable structure requires AI that sees layout like a human, a CSS engine implementing modern specs, and a rendering pipeline that works both directions. Three hard problems, each dependent on the other two. Maybe that’s why bigger companies haven’t done it. I don’t know their reasons. What I know is I spent enough time inside the problem to take an informed shot — not a naive one.
The real problem wasn't missing Flexbox support. It was deeper: when a flex container crosses a page boundary, you need to split it — but the split changes available space, which changes how items distribute, which changes where the next split happens. Layout, pagination, and reflow are three interdependent problems. Every existing library solves them independently. That's why they all break.
Flexbox per W3C spec — §9.1 through §9.8, every min-size constraint and frozen-item iteration. Tables with colspan, rowspan, header repetition across pages. Font subsetting with composite glyph resolution and ToUnicode CMap. And the hard part — pagination that understands flex containers, splits them mid-page, and re-resolves layout after the split. Three problems solved together, not independently.
The engine renders HTML to PDF. So I flipped it: AI converts any PDF to HTML, user edits visually, engine renders back. Built a full editor — rich text, table operations, drag-and-drop, templates for creating documents from scratch. Embedded the HTML source inside every exported PDF for instant re-editing.
The core document types work reliably. Complex edge cases in AI conversion still need improvement — I'm actively fixing them, shipping updates the same week users report issues.
There’s a pattern I keep seeing: an AI startup ships a tool that converts your document, gives you the result, and that’s it. If the output is 90% right, you’re stuck with the 10% that’s wrong. No way to fix it. Take it or leave it.
I think that’s backwards. The best AI result is one you can correct — not one that’s magically perfect, because that doesn’t exist for complex documents. The best result gives you 90% and then hands you real tools to fix the remaining 10% yourself.
That’s why ReflowPDF isn’t an AI tool with a download button. It’s a full visual editor built to work with the AI’s output. You can also create documents from scratch without AI at all. And every time you export, your corrections are preserved in the embedded source. Next time you open that PDF, the AI isn’t involved.
This isn’t an AI product that happens to edit PDFs. It’s a PDF editor that uses AI where it makes sense — and gives you full control everywhere else.
Security goes first, not last. Across the libraries I studied, security was almost always an afterthought. Font files accepted without validation. Remote resources loaded by default. SVG parsed without XXE prevention. These weren’t edge cases — they were architectural gaps. I wrote input sanitization, URL validation, font magic-byte checks, and image decompression limits before writing a single layout function.
Pagination can’t be separate from layout. This was the universal mistake. Every library treats pagination as a post-processing step — run layout, then split across pages. That breaks the moment a container or table crosses a boundary, because the split changes available space, which changes the layout, which moves the split point. My engine resolves them together — same pass, not two separate passes.
Don’t depend on someone else’s runtime. Headless browsers get too heavy for production. Archived projects leave you with a dead dependency. Commercial licenses change terms. I wrote every component — parser, resolver, layout engine, font subsetter, PDF writer — so when something breaks, I fix it. No upstream to wait on.
Keep layout and rendering separate. Several libraries tightly couple position calculation with PDF drawing. That makes adding new layout modes nearly impossible without rewriting the renderer. I kept them in separate layers from day one. Adding Flexbox meant adding a layout class. The PDF writer never changed.
If you create a document in the editor — from a template or from scratch — it works reliably. Add pages, build complex layouts, export. The engine handles large documents well because it was built for that from the start.
Where it gets harder is AI conversion of complex existing PDFs. A clean invoice or a standard contract converts accurately. But the more nested the layout — multi-column sections inside tables inside flex containers, decorative elements overlapping content — the more the AI has to guess, and guesses aren’t always right. I’m improving conversion accuracy continuously, but I want to be upfront: heavily layered documents might need adjustment after import.
That’s exactly why the editor exists. The AI gives you the structure. The editor gives you the tools to make it right. And once you export, that corrected version is preserved — no AI involved next time.
The thing I care about most isn’t a feature list. It’s this: you should be able to open any document, change what you need, and have the result look like it was always that way. No broken tables, no overlapping text, no manual repositioning. Just edit and done.
Right now that works for standard business documents. The gap is complex, heavily designed PDFs — and I’m closing it. Every week the AI gets smarter about nested layouts, every week the editor handles one more edge case.
After every export, the editor asks how it went. If something didn’t work and you choose to share the document, I treat it as a dedicated case — it goes into a tracking system I built specifically for polishing conversion accuracy. Every shared case gets investigated individually, not triaged into a backlog. That’s how the product gets better: real documents, real problems, fixed one by one.
Upload a PDF or create from scratch. Edit a table, add a paragraph, watch the document reflow instead of breaking.
Founding-member pricing locked forever for waitlist subscribers.