pjkundert / python-slip39

Generate Ethereum, Bitcoin, etc. account seed and backup Mnemonics in SLIP-39 format (Trezor & Ledger compatible), with details in printable PDF format. Optionally, also print encrypted JSON and BIP-38 paper wallets.
https://slip39.com
Other
50 stars 17 forks source link

ZeroDivisionError when printing paper wallet on A4 page #10

Closed fdegros closed 4 months ago

fdegros commented 11 months ago

When running:

$ python3 -m slip39 -c BTC -w password --paper a4
...
2023-07-12 17:59:10 slip39           Failed to write PDFs: integer division or modulo by zero
Traceback (most recent call last):
  File ".../python-slip39/slip39/main.py", line 187, in main
    write_pdfs(
  File ".../python-slip39/slip39/layout/pdf.py", line 504, in write_pdfs
    p,(offsetx,offsety) = page_xy( wall_n )
                          ^^^^^^^^^^^^^^^^^
  File "/home/fdegros/experimental/python-slip39/slip39/layout/components.py", line 552, in page_xy
    page,nth            = divmod( num, comps_pp )
                ^^^^^^^^^^^^^^^^^^^^^^^
ZeroDivisionError: integer division or modulo by zero

I suspect this has something to do with the fact that the paper wallets are slightly too wide to fit on an A4 page.