Skip to content
Skip to content
Gooseleggs Site

Ramblings

← Ultrastar on Ubuntu 14.04
Remove security headers from HTTP responses →
-->

Get WkHtmlToPdf to work in CakePHP 2

Posted on November 25, 2018 by admin

Doing a website, and using the code from here: https://github.com/Milanzor/cakephp-wkhtmltopdf

Problem was that I was getting blank PDFs back.  Turns out it does not do error handling very well.

After debugging the output command etc, and it bombing out with “host not found” type errors, I copied from the “Tips and URLs” section into AppHelper, and this resolved the issue.

https://www.dereuromark.de/2014/04/08/generating-pdfs-with-cakephp/

Basically, it just ensures that when printing out to PDF it uses absolute URLs instead of relative (which don’t work from a text file)

This entry was posted in CakePHP. Bookmark the <a href="https://www.thesmithcave.nz/?p=250" title="Permalink to Get WkHtmlToPdf to work in CakePHP 2" rel="bookmark">permalink</a>.
← Ultrastar on Ubuntu 14.04
Remove security headers from HTTP responses →

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

© 2025 | Blog info WordPress Theme | By Bharat Kambariya