Skip to content

Convert images of 2.5x3.5 game cards to letter-sized pdf sheets with guidelines for cutting with scissors once printed, primarily for print & play games.

Notifications You must be signed in to change notification settings

Chuntttttt/Cards

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cards

macOS build Windows build Ubuntu License: MIT Code style: black

Requirements

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.

Usage

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:

3x3 example

5x5 example

About

Convert images of 2.5x3.5 game cards to letter-sized pdf sheets with guidelines for cutting with scissors once printed, primarily for print & play games.

Resources

Stars

Watchers

Forks

Languages