I have a lot of projects that consist of collecting information and then rendering it to PDF, initially I used tcpdf, but the rendering is VERY finicky. I was doing some additional research a few weeks ago for a personal project and found wkhtmltopdf. I was scraping my Harvest time sheets to gather my hours for the previous two weeks, rendering to a PDF, and automatically creating a RightSignature document to be signed by my employers. If you’ve ever had to do this, it can be somewhat of a pain to do repeatedly, especially when you’re really busy. Plus, automating things is awesome. For that process, I used some python (with Requests), wkhtmltopdf, and Xvfb's (X virtual framebuffer) xvfb-run command. This is fine, because I run the process manually, at will. I have some other projects that require repeated rendering on a live site, for multiple users. Running individual xvfb-run processes for each request is just a dumb idea. Your server is going to explode if you do this. Don't do it. In order to use a single Xvfb process, I needed to set it up as a daemon that is run by the www-data user, so that the PHP wrapper I am using (PHPWkHtmlToPDF) can access the virtual frame buffer, and use the webkit rendering engine (Chrome) to save it to PDF. I could (and probably will) setup a processing queue using rabbitmq or the likes, but for now (and for this post), this is fine. Let’s get started, shall we? These instructions are centered around Ubuntu, so your milage may vary depending on the setup you are using.