Blank PDF Certificates in Moodle

I had a strange issue today with a client agency building a new LMS using Totara’s implementation of Moodle that might help someone.

The LMS generally worked fine, when the user completed a course and went to download their PDF certificate, it appeared to be generated correctly and previewed correctly on a Mac, but when viewed in Acrobat it was blank. It was a high profile project and is to be shown to the end client tomorrow, so the pressure was on.

Oddly, the client had a similar site on the same server that worked fine. I scratched my head for a while and went down a few blind alleys before noticing that the PDF generator was TCPDF and the problematic site had a slightly newer version. I took a chance and swapped the /lib/tcpdf folder from the working instance to the new and everything started working correctly.

Not sure what the cause of the problem was, but the client is happy.