Skip to content

Add --backgrounds and --no-backgrounds options - #39

Open
fdegros wants to merge 1 commit into
pjkundert:masterfrom
fdegros:backgrounds-option
Open

fdegros wants to merge 1 commit into
pjkundert:masterfrom
fdegros:backgrounds-option

Conversation

@fdegros

@fdegros fdegros commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

The cover page image, the Paper Wallet background and its diagonal cryptocurrency names, the watermark, and the diagonal group labels on the cards are always printed. This makes it an option, so that the PDF can be plainer to read and cheaper to print (no background image behind the Paper Wallets and the cover page, and no text across the cards):

slip39 --no-backgrounds ...

It is a backgrounds argument of produce_pdf and write_pdfs, defaulting to the new defaults.BACKGROUNDS, which is True: the output is unchanged unless --no-backgrounds is given. The command line options follow the style of --cover and --no-cover.

  • Change: slip39/defaults.py (BACKGROUNDS), slip39/layout/pdf.py (the cover image and fade, the card group labels and watermark, the wallet background and diagonal names are only set if backgrounds), slip39/main.py (the two options), and the usage in README.org.
  • Tests: new slip39/backgrounds_test.py records the template values rendered into the PDF, with and without backgrounds and by default (cover, cards and, if scrypt is available, a BIP-38 Paper Wallet), and checks that the command line options are passed to write_pdfs.
  • pytest (without the invoice/communications tests, which need optional packages): 44 passed, 4 skipped.

Note that the Paper Wallet's semi-transparent white overlays (behind its text and QR codes) are still set without backgrounds; on white paper they print nothing.

The cover page image, the Paper Wallet background and its diagonal cryptocurrency names, the
watermark, and the diagonal group labels on the cards were always printed.  Make it an option:
a `backgrounds` argument of produce_pdf and write_pdfs, defaulting to defaults.BACKGROUNDS
(True, so the output is unchanged), selected on the command line with --backgrounds and
--no-backgrounds, like --cover and --no-cover.

With --no-backgrounds, the PDF is plainer to read and cheaper to print: no background image
behind the Paper Wallets and the cover page, and no text across the cards.

Add backgrounds_test.py.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant