top | item 47162007

Show HN: Prince Cloud – Create PDFs with AI Agents

2 points| mikeday | 4 days ago |prince.cloud

We've been working on Prince for over twenty years and consider it the best way of getting HTML + CSS (and now Markdown!) into PDF, so it's bothered me that AI agents struggle with this, even writing Python programs to generate PDF and then getting confused when you ask for edits. So we've made an MCP server to make PDFs easier!

It exposes three tools: markdown_to_pdf, html_to_pdf, and url_to_pdf, so prompts like "Create a beautifully formatted invoice" can be handled appropriately. LLMs are great at generating Markdown and HTML and Prince is great at typesetting it to high-quality PDF, so this workflow should assist with documents that require careful formatting, multiple revisions, or PDF accessibility features.

We're still figuring out the best way to package this so it can be used ergonomically. Our first attempt simply returned the PDF file to the agent directly, but the LLM would often struggle to decode it, so now it caches the PDF on the server and returns the URL for you to download it, which keeps the response small and the agent happy. (There's a download button widget to make it look nicer in ChatGPT).

I'm curious if anyone has been making PDFs from AI agents and what they think of this approach! Of course you could also call Prince through a local/stdio MCP or run it directly from the command-line, or use the DocRaptor online service, but it's nice to have an example to play with that only requires pasting in the endpoint without installing anything or even creating an account.

Website: https://prince.cloud

Prince: https://www.princexml.com

DocRaptor: https://docraptor.com/

discuss

order

No comments yet.