How to create a second page in the certificate pdf?

How to create a second page in the certificate pdf?

by Sidney Amorim -
Number of replies: 3
Hello to all
I would like to know somebody knows how to create a second page in the certificate pdf to put the content of the course.

Thank you for the help.
Average of ratings: -
In reply to Sidney Amorim

Re: How to create a second page in the certificate pdf?

by Jose Navas -
I have the same problem, and although I have not found a ideal solution, I'm just added one or two additional certificate activities, that are configured the same, only the name or certificate design changes. In this way the student can print the certificates that they want or need.
In reply to Jose Navas

Re: How to create a second page in the certificate pdf?

by Sidney Amorim -
It is a great idea. Thanks for your help.
In reply to Sidney Amorim

Re: How to create a second page in the certificate pdf?

by Raymond Fürst -
try
$pdf->AddPage();
to add another page to your certificate. This Line is used in the file mod/certificate/type/YourType/certificate.php to generate the first page too.

It should inherit page settings from the previous page. You may have to copy the print_border(), draw_frame() and print_watermark() commands to make the second page look like the first page.

Basically each certificate.php has the following structure:

(PHP-inclusion commands)
(grade-formatting, date-formatting etc.)
// Create a new document
$pdf = new TCPDF_protection();
(pdf basic settings)
$pdf->AddPage();

// Add images and lines
print_border()
draw_frame()
print_watermark()
print_seal()
print_signature()

// Add Text
cert_printtext() für each text bit