Certificate printing to A4 instead of Letter

Certificate printing to A4 instead of Letter

av Nevin Reid -
Antal svar: 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.


Bilaga certificate_in_acrobat.png
Bilaga pdf_properties.png
Medeltalet av utvärderingarna: -
Som svar till Nevin Reid

Re: Certificate printing to A4 instead of Letter

av 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

Medeltalet av utvärderingarna: -
Som svar till Doug Kelley

Re: Certificate printing to A4 instead of Letter

av 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

Medeltalet av utvärderingarna: -
Som svar till James Todd

Re: Certificate printing to A4 instead of Letter

av Doug Kelley -

Thank you, Jimi. I shall take a look.

Have a great day!

Doug Kelley

Medeltalet av utvärderingarna: -
Som svar till Nevin Reid

Re: Certificate printing to A4 instead of Letter

av 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 leende

Bilaga config_LETTER.JPG
Medeltalet av utvärderingarna: -
Som svar till Ellen Carnahan

Re: Certificate printing to A4 instead of Letter

av Doug Kelley -

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

I really appreciate it.

Doug Kelley

Medeltalet av utvärderingarna: -