This Project is to demostrate a very basic svg templating workflow. It can help to batch process lots of data into svg files.
Works with Python 3.6.
After cloning the repository, please install the requirements
pip install -r requirements.txt
Modify the code to your needs, and run it by executing
python svg_templating.py
Sometimes output in the pdf format might be required. This can be achieved by using convert and a for-loop.
for file in *.svg; do; convert ${file} `basename ${file} .jpg`.pdf; done
To combine all output pdfs into one file (e.g. for printing) pdfjam/pdfjoin can be used.
pdfjoin dnb-dbsm-boe-bl-p-00*.pdf --outfile cards.pdf
Please note, that you have to adapt the first part of the filename wildcard to your needs, if you happen to choose different files.
All Files to be put in the template should have the same/similar aspect ratios. Otherwise, they will be stretched to match the aspect ratio defined in the template.
Preprocessing can be made with imagemagick command line tools like mogrify.
GNU General Public License v3
2018, Universitätsbibliothek Leipzig
Florian Rämisch <raemisch@ub.uni-leipzig.de