Skip to content

Instantly share code, notes, and snippets.

@aur1mas
Created December 8, 2010 10:14
Show Gist options
  • Save aur1mas/733109 to your computer and use it in GitHub Desktop.
Save aur1mas/733109 to your computer and use it in GitHub Desktop.
<?php
try {
$wkhtmltopdf = new Wkhtmltopdf(array('path' => APPLICATION_PATH . '/../public/uploads/'));
$wkhtmltopdf->setTitle("Title");
$wkhtmltopdf->setHtml("Content");
$wkhtmltopdf->output(Wkhtmltopdf::MODE_DOWNLOAD, "file.pdf");
} catch (Exception $e) {
echo $e->getMessage();
}
@rom117
Copy link

rom117 commented Oct 29, 2011

Hello,

Thank you for your reply.
I've added the line $wkhtmltopdf->Wkhtmltopdf::_render; at the end.
I've got this error: "The website encountered an error while retrieving http://localhost/test/. It may be down for maintenance or configured incorrectly".
So it's not working anymore.

How can I display the full exception?

Many thanks,

Romain

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment