Open getflourish opened 1 month ago
Thanks for your feedback. I'll look into it quickly.
I now installed it with composer which does solve that issue. I never used composer before, but apparently, it’s straightforward.
I also installed the macOS build of wkhtmltopdf.
When I try to open a PDF, the PHP server hangs. When I kill it, I get these error messages:
WKHTMLTOPDF didn't return any data
Any idea how I can check if wkhtmltopdf is installed properly?
Ah, I just checked: wkhtmltopdf is installed as I can use it on the command-line.
So I need to find out why it’s not returning anything to the plugin…
You can check if WkHtmltoPdf is installed in your terminal by running :
wkhtmltopdf --version
This should print the version installed (preferably with Qt patched)
Then you can try to render google homepage by running :
wkhtmltopdf https://google.com google.pdf
And then check that google.pdf file created is ok
wkhtmltopdf works from the command-line. I now have the Google Homepage ready to print :D
I wonder if my PHP on macOS has access to it? Permission issues?
Sure, could be a permission issue, make sure that the php user can execute wkhtmltopdf binary
I ran this directly in a Kirby template and it worked. Okay, I will now try to use the plugin with a very simple template and debug further.
Sorry, this is now unrelated to the original issue and I might open another one once I figured out why it’s not working. But we’ll get there, I’m sure :)
<?php
$command = '/usr/local/bin/wkhtmltopdf https://www.google.com output.pdf';
$output = shell_exec($command);
?>```
Okay, solved it. Any kind of JavaScript on a template seems to break wkhtmltopdf and freezes the server. It works with simple templates (which I will need anyway). But I better make sure that I disable rendering of any template other than the specific PDF ones :)
I'll still look into install without composer. But i'll open another one for javascript issue
I’m excited about this plugin!
I tried installing it by downloading the source and moved it to
/site/plugins/pdf
It looks as if Kirby picks it up, but the plugin itself throws an error:
Class "Maxchene\KirbyPdf\KirbyPdf" not found