# Papermill Press – An AI-friendly markup language for PDF ge…

If you’ve generated PDFs from HTML, you’ll know the pain: headless Chrome in Docker, CSS hacks, content that flows over pages or table boundaries and other quality issues. The fundamental problem is that HTML was designed for screens, not print. We built Press, a markup-based document language wher…

- **Page:** https://magpie.gallery/i/papermill-press-an-ai-friendly-markup-language-for-1ray
- **Type:** Link to an idea elsewhere
- **Category:** AI & dev
- **Tags:** pdf, markup-language, document-generation, layout, templates

## Source

Web · davidpapermill: Papermill Press – An AI-friendly markup language for PDF generation

- **Original:** https://news.ycombinator.com/item?id=48477708

> If you’ve generated PDFs from HTML, you’ll know the pain: headless Chrome in Docker, CSS hacks, content that flows over pages or table boundaries and other quality issues. The fundamental problem is that HTML was designed for screens, not print. We built Press, a markup-based document language where pages, content flows, and assets are first-class concepts. Content can flow across frames, columns, and pages without manual pagination. Pages are created dynamically based on the available content. Press templates separate layout from content. You can send markdown, Press markup, or a mixture of both to the API. Data can be sent in JSON, CSV, XML. Because Press is XML-based it can easily be generated by agents - some of our users are generating complete documents in a single shot, although the language is designed for repeatable automation. You can also use our MCP server, which enables models to design templates. A simple API call sends a markdown payload, which is injected into a <flows><body>…</body></flows> element in Press: curl -X POST https://api.papermill.io/v2/pdf?template_id=papermill-modern-report \ -H "Authorization: Bearer $PAPERMILL_API_KEY" \ -H "Content-Type: text/markdown" \ --data-binary @- \ -o report.pdf <<'EOF' # Q3 Revenue Summary Quarterly performance across our core product lines. | Product | Revenue | Growth | |----------|----------|--------| | Platform | £482,000 | +18% | | Add-ons | £124,000 | +42% | | Services | £67,000 | -3% | Strong quarter overall, driven by add-on adoption. EOF PDF output: https://mill.pm/hn Pages and frames in Press can declare dependencies on a content flow like the <body> above. By default, if there’s no content in the flow then the frame or page won’t be generated. You can run flows between frames and pages, and combine multiple flows on a page - for example, a sidebar can run across pages until no content is left, then make room for body content. This makes it possible to implement complex layouts. You can mix markdo

## Rules for reuse

- Build your own version: don't copy another product's code, look, icons, colours or copy.
- The original belongs to its author; Magpie only links to it.
- The original content's copyright belongs to its creator. Magpie doesn't download or re-upload it; we only show the link and the official preview.
