PDF Creation stopped working

I wanted to share my experiences with PDF generation which has suddenly stopped working after the most recent update and it reports Error creating PDF file, contact technical support.

I’m using cPanel for my hosting with Intel processors.

The problem seems to be the latest version of the wkhtmltopdf-amd64 is not working or corrupt. Fortunately the old version was there and labelled wkhtmltopdf-amd64_bkup. When I restored this to be the current file it worked again.

Unhelpfully, part of the initial SC advice (by email) to fix this included the advice to make sure all directories are 755 and files are 644. However, this specific file must be 755 to run and without those file permissions it will fail anyway (as Command not found at the terminal / Error on a website.

There are some useful guidelines on working through issues on the PDF creation but they miss out this detail. They also (at the moment) also link to downloading the same (no-working) updated version of the wkhtmltopdf-amd64 file.

Ironically, I needed to fix this again and needed these notes.

I realised that I had accidentally stopped it working by executing:
find . -type f -exec chmod 0644 {} \;
to make sure Apache worked after doing a large update that featured some new folders.

As soon as I went to
and changed permissions back to 755 it worked again. No other fixing required.

Of course, depending on where you are running this you may need a different variant of the file.