41de28fae4 | ||
---|---|---|
flags | ||
avatar.png | ||
badge_azzurro.png | ||
badge_giallo.png | ||
badge_rosso.png | ||
badge_verde.png | ||
badge_viola.png | ||
ext.py | ||
flag.svg | ||
gen_badges.py | ||
readme.md | ||
template.svg |
readme.md
Badge Generator
Editing hundreds of badges by hand was a tedious and time consuming project, so it was automated with this script.
Why not the Pretix badge generator?
Pretix badge generator was particularly hard to use and special cases (like the custom background based on role) was pretty much impossible.
How does this work?
The script "gen_badges.py" will:
- Fetch all orders from the pretix api
- Fetch details from each order, and use it to edit a SVG template. Rather than using XML libraries, everything is done with python built-in ".replace()" function with no regards on potential XML corruption.
- Render all the resultant SVG files to PDF (using inkscape)
- Merge all the separate PDF files to a combined one (using pdfmerge)
How do i create the template?
Just use Inkscape and then manually edit the paths of the *.svg file or find out how to replace them. Make sure to "vacuum document" and "export as a regular SVG" so that the file is simpler and easier to edit.