Requires MuPDF, available on macOS via homebrew:
$ brew install mupdf swig freetype
Adapted the MuPDF sample: https://github.com/pymupdf/PyMuPDF-Utilities/blob/master/examples/all-my-pics-embedded.py
Uses poetry for dependency management.
Cards is a CLI tool, you can use it to turn a folder of the structure:
cards/
front/
card_01.png
card_02.png
...
card_50.png
back/
back_01.png
back_02.png
...
back_50.png
Into a pdf that adds guidelines for cutting the cards and interleaves the front and back cards.
The card images should be 2.5x3.5 (poker card ratio). You can set the number of rows/columns by passing the 'sides' argument (defaults to 3x3 on each page).
If there are more front cards than there are back cards the last back card will print to be the back to the remaining unmatched front cards.
Example invocation:
$ cards --cards-path path/to/cards --output cards.py --sides 5
Example outputs: