4 Commits

Author SHA1 Message Date
valknar 38ac178ab7 fix: replace networkidle0 with load + image-complete wait for file:// pages
networkidle0 is unreliable for large local documents; explicit image
decode check is more robust.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 21:19:55 +02:00
valknar f6f15a376e fix: raise Puppeteer timeouts to 120s for 99-page illustrated book
Default 30s is too short when loading and rendering many local images.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 21:16:32 +02:00
valknar 2abcda73e8 Add Ghostscript post-processing to pdf.js for KDP compliance
- Puppeteer writes to a temp kaleidoskop-raw.pdf
- Ghostscript re-processes with -dPDFSETTINGS=/prepress to fully embed
  all fonts and prevent subsetting (KDP checklist item 6)
- PDF info dict is written via PostScript pdfmarks, with title/author/
  subject encoded as UTF-16BE hex to support German umlauts (item 13)
- File size drops from ~108 MB to ~9 MB (placeholder art; will grow with
  real 300 DPI illustrations but stays well under KDP's 650 MB limit)
- GS failure falls back gracefully to the raw Puppeteer PDF

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 19:08:35 +02:00
valknar a8ade90ffb Set up book project: Markdown→CSS→PDF pipeline for KDP
Adds the full authoring and build toolchain for "Das Kaleidoskop der
Schlummerwelten" — all 12 story content files in Markdown, Nunjucks
HTML templates, CSS print layout, and Puppeteer-based PDF generation
targeting Amazon KDP (8.5×8.5 in, 0.125in bleed).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 15:38:07 +02:00