Takes a spreadsheet from Patreon and some mailing label sizing parameters and outputs a print-ready PDF of mailing labels.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
erinn 8e9d00b34a add license 3 years ago
.gitignore initial commit 3 years ago
LICENSE add license 3 years ago
Readme.md initial commit 3 years ago
csv.go initial commit 3 years ago
go.mod initial commit 3 years ago
go.sum initial commit 3 years ago
main.go initial commit 3 years ago
preview.png initial commit 3 years ago


Mailing Label Printer

First cut, command-line only for now; GUI is coming!

This utility takes a spreadsheet of addresses, along with some configuration specifying the dimensions of your mailing labels, and outputs a PDF file with the labels pre-filled and ready to print.

This is designed to work with the CSV files output by Patreon's Benefits Tracker tool, but should in principle work with any properly formatted CSV file. Mailing labels are specified using the Go template language and the first row is used to determine column names; see the -template option below for an example.

Preview (using fake data from Brian Dunning):

mailing label preview


  -cols int
        number of columns (default 3)
  -csv string
        CSV file (downloaded from Patreon)
  -fontfamily string
        font family (default "Arial")
  -fontsize float
        font size (default 10)
  -fontstyle string
        font style (B for bold)
  -gapx float
        gap between columns (default 3.4)
  -gapy float
        gap between rows
  -h float
        label height (default 25.4)
        draw lines?
  -o string
        filename to output PDF to (default "out.pdf")
  -paper string
        paper size (default "Letter")
        portrait mode? (default true)
  -row int
        number of rows (default 10)
  -skip int
        skip labels (useful for printing on partially-printed label sheets
  -template string
        mailing label template (default "{{.Addressee}}\n{{.Street}}\n{{.City}}, {{.State}}\n{{.Zip}}, {{.Country}}\n")
  -unitStr string
        units to use for other measurements (default "mm")
  -w float
        label width (default 66.8)
  -x float
        left margin (default 6.5)
  -y float
        top margin (default 12.7)

Known Bugs

  • Text that doesn't fit on one line isn't wrapped. For now, you can manually insert a linebreak in the relevant cell (using Calc or Excel or your preferred spreadsheet editor).
  • unitStr doesn't affect fontsize
  • In general nothing stops you from setting parameters that don't add up to the page dimensions
  • Empty-address detection only works for Patreon CSVs