How to Customize Certificate template?

1,731 views
Skip to first unread message

Saikou

unread,
Oct 21, 2015, 6:40:46 PM10/21/15
to General Open edX discussion
Hey everyone,


I have fullstack cypress installed on ubuntu.

I'm currently able to generate a certificate.pdf for a specified user (see the attached file).

Does anyone know how to edit the certificate template in order to customize it with a custom content, logo, signature and also replace the professor name with the course professor's name.

Also, how can I replace "Rolling" on my certificate with the issued date.

Thanks in advance for you help guys!

Regards,
Saikou
Cliquez ici pour répondre
Screen Shot 2015-10-19 at 21.28.47.png

stv stnfrd

unread,
Oct 21, 2015, 9:31:48 PM10/21/15
to General Open edX discussion

Hi Saikou,

We've done quite a bit of work at Stanford with PDF certificates. At
last week's OpenEdX Conference Hackathon, our team worked on and
presented 2 projects to ease use and adoption of the certificates
repository.

Namely, Giulio Gratta created "version 4 fully dynamic" templates which
will allow for 100% of a template's creation to be performed dynamically.
He's currently working to polish up that work during this development
sprint [1]; we hope to release it publicly soon.

In the interim, the most advanced PDF certificate solution is "version 3"
(it looks like you're still using the old default, "version 1").
V3 templates allow for _most_ content to be rendered at runtime (date,
username, course title, explanatory text, footer text). The few
remaining items (border, logo, and professor name/signature) are embedded
directly into the PDF template. In practice, this means we currently
have one template per instructor.

To get a better idea, you can go ahead and generate a sample V3
certificate as follows:

```shell
python ./create_pdfs.py --no-upload \
    --course-id 'course-v1:edX+DemoX_v3+Demo_Course_v3' \
    --long-course 'v3 Test Course' \
    --name 'Giulio G. Gratta'
```

This will generate a certificate using the default template [3] that looks
like this [2]. To customize further, you can create a new PDF template
that updates the default [3]. After saving the new PDF [4], you can
generate an example with your new template like this:

```shell
python ./create_pdfs.py --no-upload \
    --template-file 'certificate-template-unique-name.pdf' \
    --course-id 'course-v1:edX+DemoX_v3+Demo_Course_v3' \
    --long-course 'v3 Test Course' \
    --name 'Giulio G. Gratta'
```

As I said, we're hoping to finish v4 soon, which will obviate the need
to ever edit any PDFs directly. But while you wait, feel free to poke
around v3 to get started.

I hope you find this useful; please let us know if you have additional
questions!

-- stv, stanford

[1] https://github.com/Stanford-Online/openedx-certificates/pull/11
[2] see attached screenshot
[3] `template_data/v3_dynamic-cert-templates/certificate-template-edX-DemoX_v3.pdf`
[4] Save to `template_data/v3_dynamic-cert-templates/certificate-template-unique-name.pdf`.



Screen Shot 2015-10-21 at 6.11.08 PM.png

Saikou

unread,
Oct 26, 2015, 1:00:49 PM10/26/15
to General Open edX discussion
Hello stv stnfrd,

First of all, I'm sorry for the late answer, I didn't get a notification for you reply. I just cheiked out and saw you answer.

Thanks a lot for your reply, this is working like a dream :)

However I have few questions.

when I run the "regenerate_user" in order to generate a certification for a single user, it immediately uses the v1 certificate script. So I was wondering if there's any way to link the "create_pdfs.py" script to "regenrate_user" script so it would be possible to follow the whole workflow:

- grade the student
- generate the certificate
-add it to MySql DB
- display the "download button" on student's dashboard

Thank you in advance.

PS: How can we get notified when the "version 4 fully dynamic" is available?

Mark Kreitler

unread,
Nov 9, 2015, 4:32:46 PM11/9/15
to General Open edX discussion
Hey Stv Stnfrd,

I'm sorry to butt in, but I'm having a fundamental problem with certificates and it sounds like you're an expert. I've tried posting elsewhere and haven't had any reply. I'm hoping you can point me in a good direction.

I'm running a Cypress devstack and cannot see any "certificates" section under the site administration options. The certificate setup documentation has changed a lot in the past week and a half, and I have no confidence in the steps I'm trying, which are:

1) Install Cypress (I can seem to do this OK)
2) Create a superuser via


sudo su edxapp -s /bin/bash
cd ~
source edxapp_env
python /edx/app/edxapp/edx-platform/manage.py lms createsuperuser --settings devstack

This also works.

Set

CERTIFICATES_HTML_VIEW to True in both the lms and cms versions of common.py, then migrate the changes via:

sudo su edxapp -s /bin/bash
cd ~
source edxapp_env
python /edx/app/edxapp/edx-platform/manage.py {lms/cms} syncdb --migrate --settings=devstack

At this point, I expect to be able to log into Studio, go to the /admin page, and see "Certificates" listed in the site administration options, but no such option appears. Mine skip from 'Auth' to 'Content Store'.

If you're aware of up-to-date docs that correctly describe how to activate certificates and badges for Cypress, could you please share the knowledge (along with your Amazon 'wish list')?

Many thanks!

Mark Kreitler

Liubov Fomicheva

unread,
Nov 12, 2015, 11:10:27 AM11/12/15
to General Open edX discussion
Hello Saikou,

  The version of generator is specified in cert-data.yml file in certificates application directory, one certificate configuraion per course (see default as example: https://github.com/edx/edx-certificates/blob/master/cert-data.yml).
  Unfortunately there is no *magic* way to customize it with ansible configuration, but you can add variable CERT_PRIVATE_DIR in your certs installation environment configuration or env.json file (by default it equals to app root) and then put all the templates and corresponding cert-data.yml to the specified private directory.

Our team is going to use lates certificate version too, so we'll be very glad to know about your experience.

Best wishes,
Liubov

понедельник, 26 октября 2015 г., 20:00:49 UTC+3 пользователь Saikou написал:
Reply all
Reply to author
Forward
0 new messages