This repository contains two C-based PDF generators built around libharu:
Kinderstadt Ausweis Befüller: generates participant ID cards from CSV dataMoney generator: generates printable play money sheets
Kinderstadt Ausweis Befüller/Money generator/
This project generates PDF ID cards for children's activities based on CSV files.
The tool automates the creation of participant ID cards. Data (name, role, etc.) is read from CSV files and merged into a PDF.
programm.c: PDF rendering (layout, fields, page structure)pipe_inputer.c: CSV input for a simple single-group scenariopipe_inputer_dualkey.c: CSV input with role mapping from a separate filequickstart.sh: predefined quick start with example filesgen_id.sh: interactive start for the simple scenariogen_id_dualkey.sh: interactive start for role mappingroles.txt: roles and RGB color valuesTeilnehmer2024.csv: example input file
- Linux
gccmakelibharu(-lhpdf) including headers/library in the compiler/linker path
Note: The repository includes sources for libharu and libpng, but the default build uses the local compiler/linker (gcc ... -lhpdf). If libhpdf cannot be found, install the library first or configure linker/include paths accordingly.
Run from the repository root:
cd "Kinderstadt Ausweis Befüller"
chmod +x quickstart.sh
./quickstart.shInternally, the quick start does:
make- Reads
roles.txtandTeilnehmer2024.csv - Pipe call:
./pipe_inputer_dualkey.run roles.txt Teilnehmer2024.csv Rolle Vorname Name Extra | ./programm.run out 1 - Generates
out.pdf make clean
Participant CSV example (Teilnehmer2024.csv):
Vorname;Name;Rolle;Extra
Bennet;Richter;Team;1:3The quick start expects these column names:
RolleVornameNameExtra
roles.txt maps roles to colors in blocks:
#Team
235
0.0
0.0
#Buerger
87
153
36Per-role schema:
- Role name prefixed with
#(for example#Team) - Red value
- Green value
- Blue value
cd "Kinderstadt Ausweis Befüller"
chmod +x gen_id.sh gen_id_dualkey.sh
./gen_id.sh
# or
./gen_id_dualkey.shLayout changes (positions, fields, sizes, visual structure of the ID cards) are currently not configurable via config files.
If you want to change the card layout, you currently need to modify and recompile the C code, mainly in:
Kinderstadt Ausweis Befüller/programm.c
cd "Kinderstadt Ausweis Befüller"
makeBuild output:
programm.runpipe_inputer.runpipe_inputer_dualkey.run
Clean up:
make clean- CSV keys (column names) must match the provided parameters exactly.
- The layout is hardcoded and not configurable.
- Error handling and input validation are currently basic.
The Money Generator creates printable PDF sheets with play money entries.
Money generator/programm.c: rendering logic and command line parsingMoney generator/resources/: fonts and images used in the PDF designMoney generator/makefile: build target forprogramm.run
cd "Money generator"
makeThis builds:
programm.run
Run:
./programm.run <output> <Name> <Times> <Amount> [<Name> <Times> <Amount> ...]Example:
./programm.run Geld_Mix Alex 4 1 Sam 2 5 Team 1 10This creates Geld_Mix.pdf.
Argument meaning:
<output>: output filename without.pdf<Name>: label shown on the money item<Times>: how many items of this entry should be generated<Amount>: value printed on the item
- The generator uses hardcoded layout values in
Money generator/programm.c. - Visual/layout changes currently require C code changes and recompilation.