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/