Add a "Download as PDF" option

Hi all,

I have created a PHP Driven page on our website. The page is generated as the result of a form input on a previous page, a paypal payment & verification and populated with data that has been saved in the database during the whole process. It’s quite in-depth and it all works perfectly!

Now I want to take it one step further and add a button to the final page that allows the user to “Download as PDF” and I want it to do exactly that… I want to save the HTML Contents of the page in a variable, pass that to a PDF Generator of some kind and then offer that up as a download so the user can keep their digital copy of the page forever!

I’ve been toying with this all day and I just can’t seem to find the right solution.

I’ve tried DOMPDF but I think there’s an issue with the fact it can only read files in the same directory as the dompdf.php root file and because I’m using Joomla as a CMS/Templating system, the files are not all stored in the root directory and therefore it fails. I could be setting it up all wrong, I’m not entirely sure.

The page I want to convert to PDF is driven by the PHP File : (example url only to protect client data)

I read on the DOMPDF instructions that I can use a buffer to store the HTML of the page in a temporary file then redirect to dompdf but this is all new to me so I need some guidance. I know Joomla already has a built in Article PDF Reader but because this is a Template File and not an Article, that is not an option.

I could really use a bit of insight…