Skip to content

Werkov/kachna-stamping

Repository files navigation

Add headers to PDF files.

Input
=====
- CSV with header contents
  - called 'sifry.csv' with columns: id, src, dir, dst, format and others (aka Kachní mastertabulka)
  - columns are delimited by ','
  - format is optional and it should match existing template in stamps directory
- input PDF files
  - put them into 'input' directory
  - they name must be in the form '<ID>-<some string>.pdf'
- layouts for stamps (A4, A5, A6 and some custom layouts).

Output
======
- Stamped PDF files. (in 'work' directory)
- A4 PDF with smaller PDF repeated appropriately for printing (in 'output' directory)

Usage
=====
- Use generic Makefile
  - either 'make' to build everything
  - or 'make ID=<ID>' to stamp only particular file (with matching ID)
  - you can also use 'make clean' to clean all created files

Requirements
============
- bash, sed
- GNU Make
- xelatex
- pdftk
- pdfjam
- pdfinfo (e.g. part of Poppler or xpdf)
 
Demo
====
- run 'prepare-sample.sh' to put input data to their locations
- run 'make', it should stamp PDF files from your input directory

Docker
======
For a convenient usage, Dockerfile with all the requirements is included. It
expects local sifry.csv, input and output directories to be mounted.
Run `docker build -t kachna-stamping .` to build the image locally, then use it
via:
```
docker run -it \
-v "/path/to/input:/stamping/input" \
-v "/path/to/output:/stamping/output" \
-v "/path/to/sifry.csv:/stamping/sifry.csv" \
kachna-stamping
```

TODO
====
- parallel build doesn't work because of shared file 'input.tex'

About

Stamping scripts for Kachna puzzlehunt

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published