enupal / snapshot

PDF or Image generation from a URL or HTML page easily for Craft CMS
https://enupal.com/craft-plugins/enupal-snapshot/
Other
11 stars 3 forks source link

Recommended way to install `wkhtmltopdf` in a DDEV container? #57

Open lindseydiloreto opened 2 years ago

lindseydiloreto commented 2 years ago

Now that Nitro is dead, and DDEV is the official solution for local development, I feel like you're going to get this question a lot...

What is the recommended way to install wkhtmltopdf in a DDEV container?

I'm scouring the internet, and it's been very difficult to piece together the correct approach. Nothing has worked so far.

lindseydiloreto commented 2 years ago

I found the answer...

Just add this line to your /ddev/config.yaml file:

webimage_extra_packages: ["wkhtmltopdf"]

Then restart the DDEV container (ddev start).

After that, you will be able to access the following paths:

/usr/bin/wkhtmltopdf
/usr/bin/wkhtmltoimage

Hope that helps! Would be great to see this added to the documentation. 🙂

darylknight commented 1 year ago

Thanks for this Lindsey - no luck for me though. Adding that to the ddev config and restarting, it's still not available or showing up in /usr/bin/. Running which wkhtmltopdf gives wkhtmltopdf not found

Additionally, including wkhtmltoimage in that config results in not being able to start the container at all, as the startup fails with an error Unable to locate package wkhtmltoimage

I also tried to follow the plugin docs to install in Ubuntu 20.04 inside DDEV and got an error about uninstallable dependencies.

darylknight commented 1 year ago

Update: Using /usr/bin/wkhtmltopdf actually does work and lets me save the plugin settings. It just doesn't show up there inside DDEV.

image