Skip to main content

A certificate generator, from a SVG to a lot of PDFs

Project description

A certificate generator, from a SVG to a lot of PDFs

How to see an example

Get the code, and run:

./certg.py example.yaml

The example.yaml is included in the project, with the other file it uses: example_certificate.svg.

After successful execution, you will get three .pdf files, the result of the generation.

What do I need to have installed

The Python’s module yaml and Inkscape in your system.

How to really use it, you mean, for my stuff

You need to create two files: the configuration, and the source SVG. Here’s a deep explanation of how it all works, but remember you can get the examples provided and start tweaking them :)

The source SVG is the SVG you want to transform into PDFs, but with some indications for text to be replaced in. These indications are between curly brackets. For example, you may have:

Thanks {{name}} for all your {{type_of_doing}}!

Then, in the configuration file you have a replace_info variable: it’s a list of dictionaries. Each dictionary will produce a generated PDF with the info replaced, and the keys/values in that dictionary will be the info to replace.

Note that you need to provide in the config all the attributes to replace; for example:

name: Foo Bar
type_of_doing: support

Furthermore, in the config you have some mandatory variables you need to fill. Those are:

  • svg_source: the filename of the SVG you created

  • result_prefix: the prefix of the PDFs’ filenames that will be generated

  • result_distinct: the name of the variable in the replacing attributes used as a distinct string for the PDFs.

For example, if you put certs as the prefix and name as the distinct value, you’ll get as output a file named certs-foobar.pdf.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

certg-3.1.tar.gz (3.2 kB view details)

Uploaded Source

File details

Details for the file certg-3.1.tar.gz.

File metadata

  • Download URL: certg-3.1.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for certg-3.1.tar.gz
Algorithm Hash digest
SHA256 2ab9b70f23448919d7a0f46a2b0c8e2e1118a3489553b9c5561d8ee08d88fe33
MD5 e3cde0d53782c017eb2e4db58f007292
BLAKE2b-256 95d46a311995b3ca9ca57cbf1cc421003e11d8f6bbad1451e1d3280cec8591e6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page