Takes a spreadsheet from Patreon and some mailing label sizing parameters and outputs a print-ready PDF of mailing labels.
Go to file
erinn 8e9d00b34a add license 2019-12-18 13:22:15 -08:00
.gitignore initial commit 2019-12-18 12:58:15 -08:00
LICENSE add license 2019-12-18 13:22:15 -08:00
Readme.md initial commit 2019-12-18 13:11:00 -08:00
csv.go initial commit 2019-12-18 11:53:51 -08:00
go.mod initial commit 2019-12-18 11:53:51 -08:00
go.sum initial commit 2019-12-18 11:53:51 -08:00
main.go initial commit 2019-12-18 12:58:15 -08:00
preview.png initial commit 2019-12-18 13:06:12 -08:00

Readme.md

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

Usage

  -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)
  -lines
        draw lines?
  -o string
        filename to output PDF to (default "out.pdf")
  -paper string
        paper size (default "Letter")
  -portrait
        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