Certificate printing to A4 instead of Letter

Certificate printing to A4 instead of Letter

by Nevin Reid -
Number of replies: 6
I've recently gone through a major upgrade of Moodle from 2.1 to 2.3 and then to 3.0 (I'm looking to go to 3.1 but I need to get this up and running first). Everything is working well now with the exception of the Certificate module. Regardless of which base template I use for the certificate when the file opens as a PDF the page size is always A4. At first I thought I had used the wrong template to create my custom cert, but if I select either of the letter templates the PDF properties still shows me 11.69 inches as the width with a grey line on the right side where my letter-size white background border ends. I've checked the settings of certificate.php in my custom folder and they are as follows: $pdf = new PDF($certificate->orientation, 'pt', 'Letter', true, 'UTF-8', false);

I'm running Moodle 3.0.4+ (Build: 20160623) with mod_certificate 3.0 (Build: 2015111601). Has anyone else encountered this? Is it the module causing the issue or Moodle itself? Will upgrading solve this issue? I've attached a couple screen shots to better illustrate what is happening.


Attachment certificate_in_acrobat.png
Attachment pdf_properties.png
Average of ratings: -
In reply to Nevin Reid

Re: Certificate printing to A4 instead of Letter

by Doug Kelley -

Hello,

I am having the same issue. Regardless of whether I use the letter embedded or non-embedded type, the code is only generating A4 size certificates (11.69  8.27 in). 

I am using version 3.1.1 (Build: 20160711).

Any assistance would be greatly appreciated. I have used this plugin for many years and really appreciate having it available.

Thanks,

Doug Kelley

In reply to Doug Kelley

Re: Certificate printing to A4 instead of Letter

by James Todd -

The way we do it is to create an A4 jpg file with the logo at the top and signature at the bottom.

put it in the mod/certificate/pix/borders folder

The formatting and positioning is done in:

mod/certificate/type

make a copy of a folder and edit the x and y positions at the bottom of the file until your happy.


Then when creating a certificate in Moodle choose the border image in and type in design options.


Cheers Jimi

In reply to Nevin Reid

Re: Certificate printing to A4 instead of Letter

by Ellen Carnahan -

I had the same problem and have managed to solve it. 

When moodle creates pdfs, it uses the tcpdf plugin which has a file with configurations for all the different paper sizes. The certificate templates for letter and letter embedded indicate that choice in the php code, so then moodle displays the right page size for the certificate when it is generated.

The problem is, the two "letter" size php files have "Letter" - but the value listed in the tcpdf resource is "LETTER" (all caps). I edited the letter-sized certificate.pdf and changed it to all caps, and then the pdf generated with the correct size. 

I plan to email the developer of the plugin and let him know that tcpdf has changed its code. Then there should hopefully be an update that fixes this for everyone.

Hope this is helpful. Please let me know if anyone has a different understanding. Thanks smile

Attachment config_LETTER.JPG
In reply to Ellen Carnahan

Re: Certificate printing to A4 instead of Letter

by Doug Kelley -

Thank you, Ellen! This fixed the problem for me. Now I just need to redo my certificate borders back to letter size. smile

I really appreciate it.

Doug Kelley