chamilo-lms icon indicating copy to clipboard operation
chamilo-lms copied to clipboard

Certificates are created in two ways

Open lonesomewalker opened this issue 5 years ago • 9 comments

Describe When adding a custom certificate to the assessments tool, the certificate preview shows all CSS styles and integrated graphics. However, if you click on export certificate as pdf, you get a PDF without formats, graphics, only plain text.

To Reproduce Created a course at 11.chamilo.org: https://11.chamilo.org/courses/CERTIFICATETEST/index.php (ewwww, the new QR code library havocs, also visible in https://11.chamilo.org/main/gradebook/my_certificates.php )

Expected behavior Certificate should always look the same, no matter if previewed, viewed or exported as pdf.

**Server Chamilo 1.11.10

lonesomewalker avatar Aug 13 '20 21:08 lonesomewalker

QR code issue fixed on 11.chamilo.org The PDF certificate is broken on dev portals. Do you have an example on another portal somewhere? (a screenshot)

ywarnier avatar Aug 13 '20 22:08 ywarnier

Will check tomorrow on our dev (in aprox. 8h).

lonesomewalker avatar Aug 13 '20 22:08 lonesomewalker

on your dev you will need a composer update for the qr thing

ywarnier avatar Aug 13 '20 23:08 ywarnier

Is this resolved?

ywarnier avatar Nov 20 '20 12:11 ywarnier

Follow up to this: When using certificates, you can create individual ones in every course and they are generated the RIGHT way.

When visiting the list view of all certificates related to a course in the gradebook, Chamilo uses: main/template/default/gradebook/custom_certificate.tpl instead of the custom one related to the course...

Using main/template/overrides/gradebook/custom_certificate.tpl works, however the variables from the course are not passed on to this, means the generated certificates still have the placeholders in it.

Investigating further...

lonesomewalker avatar Feb 02 '22 13:02 lonesomewalker

Any update on this? It is still the case on our 1.11.26 build. We're using HTML code to create the certificate, and it loses all formatting but the images and QR code are still displayed fine.

Displayed certificate:

image

PDF generated certificate:

image

SamMaesschalck avatar Feb 16 '24 14:02 SamMaesschalck

Hello @SamMaesschalck have you tried using Chamilo's custom certificate? It is available as a plugin https://github.com/chamilo/chamilo-lms/tree/1.11.x/plugin/customcertificate and at https://github.com/chamilo/chamilo-lms/releases/tag/v1.11.26

jgnosolored avatar Feb 16 '24 15:02 jgnosolored

Hi @jgnosolored. The tool seems to do much more than we need for now. It doesn't play well with our HTML code and generates two pages even when empty. There is also an artefact, "hljs.initHighlightingOnLoad()".

Do I need to be aware of any limitations within Chamilo's PDF generator? I based the certificate on the HTML code of the default Chamilo one (i.e. I added no custom content to it). Our system seems to have trouble exporting the default certificate to PDF

SamMaesschalck avatar Feb 16 '24 17:02 SamMaesschalck

We reworked our certificate to be formatted using only tables, and that keeps the layout reasonably close to the HTML output (still not perfect). The sizing especially seems to be off compared to the HTML. The version of mPDF used seems not to like quite a few CSS attributes.

SamMaesschalck avatar Feb 29 '24 08:02 SamMaesschalck