A phone gallery has no rules. A printed book has nothing but rules. That gap is the whole product.
I built a small service that takes someone's photos and their written (or dictated) stories and produces a print-ready PDF. It's called Pianyu — https://pianyubook.com — and the part I underestimated was not the UI or the payments. It was page geometry.
Why a template library did not work
My first version was a grid of nice templates: one big photo, two photos, photo plus caption. It looked fine on screen and was wrong for print in ways I only saw on paper:
- Page breaks landed in the middle of a sentence.
- A landscape photo in a portrait slot was cropped to a portrait crop, losing the face.
- Widow lines: one word alone on a page, because the caption below pushed the text.
- Running heads collided with the top margin.
Templates assume content fits. Books require the content to be measured and then re-flowed. So the second version is an engine, not a picker.
Fixed print geometry first, everything else after
Before any design, I fixed the canvas:
- US Letter, 612 × 792 pt as the page box.
- 88 pt side margins, 96 pt bottom margin (the optical bottom looks bigger than it measures).
- Body text 12.5 pt with a 1.6–1.75 line-height; headings 20–21 pt.
- Photos are placed by aspect ratio, never by crop-to-fit. If the slot is portrait and the photo is landscape, the slot changes, not the photo.
Once the geometry is a constant, every layout decision becomes a measurement: does this paragraph fit above the photo, and if not, which page does it continue on. That is the entire engine.
The CJK font problem
The product ships in English and Chinese. A full GBK serif is around 18 MB. A subset of the glyphs actually used is about 5.6 MB. On a cold first page load that is the difference between a page that appears and a page that looks broken.
More importantly: embedding CJK in a PDF reliably was the one thing I got burned on. I started with pdf-lib, which is excellent for documents you will read on a screen, and gave up on it for CJK print output — the results were inconsistent enough that I did not trust a printer to accept them. I moved the final typesetting step to PyMuPDF, which embeds the font file directly and produces what the printer expects.
If your output is going to physical print and contains CJK, test with the actual printer before you build a product on top of it.
The free five pages
The commercial mechanism and the technical one are the same thing: the layout engine can render the first five pages for free, before payment. Nothing is hidden — those five pages are the same code path that produces the paid file, just truncated.
This changed the funnel completely. "Trust me, it will look good" does not sell a book. Seeing your own grandmother's photo set in a serif, with the caption you wrote underneath, does.
Payments were the easy part
I use a merchant of record. Tax, cards, disputes are handled upstream of me, and the webhook is a signed POST that marks an order paid after checking the amount against the SKU. Idempotent, boring, done in an afternoon.
The unsolved part is that nobody arrives. A five-day-old domain does not get indexed on demand, and a dev.to post does not bring buyers. That is a marketing problem, and it is more stubborn than any of the print bugs above.
If you want to see what the output actually looks like, two sample books (five real pages each) are here: https://pianyubook.com — and I'd genuinely like feedback from anyone who has shipped a print PDF a printer did not complain about.
Top comments (0)