I was bashing about trying to change the layout of elements on a Moodle 2.4 certificate and couldn’t for the life of me understand why changing the X and Y values didn’t really make much of a difference – nor why Moodle seemed to ignore – number values.
Then, with the help of the brilliant Paul Johnson of Klevar, we sussed it out.
There is a ‘C’ in the line of print text and image code that stands for Centre and makes all values relative to this.
Change it to L for Left or R for Right to shift elements to the relevant space on the page…
certificate_print_text($pdf, $x + 112, $y + 112, ‘C’, ‘freesans’, ”, 20, certificate_get_date($certificate, $certrecord, $course));