diff --git a/README.md b/README.md index b2660a1..8d83ba2 100644 --- a/README.md +++ b/README.md @@ -24,11 +24,11 @@ One can set the according parameters of `split_encode` to `False` to skip this s sudo pacman -S --needed qrencode imagemagick ``` -`enscript` is required to create a PDF containing the split secret in text form. +`enscript` and `ghostscript` (`ps2pdf`) are required to create a PDF containing the split secret in text form. One can set the according parameters of `split_encode` to `False` to skip this step. ```shell -sudo pacman -S --needed enscript +sudo pacman -S --needed enscript ghostscript ``` ## Usage @@ -42,7 +42,7 @@ cat > secret.txt Split the secret into 5 lines: ```shell -./enpaper.py secret.txt +enpaper secret.txt ``` Manually delete up to 2 of the 5 lines in `secret.txt_txt.txt`. @@ -50,7 +50,7 @@ Manually delete up to 2 of the 5 lines in `secret.txt_txt.txt`. Then recreate the secret: ```shell -./depaper.py secret.txt.split-text.txt +depaper secret.txt.split-text.txt ``` Print the secret: diff --git a/setup.cfg b/setup.cfg index dd048a0..7fd4e63 100644 --- a/setup.cfg +++ b/setup.cfg @@ -3,7 +3,7 @@ [metadata] name = paper-secret -version = 0.1.0 +version = 0.1.1 author = Daniel Langbein author_email = daniel@systemli.org description = Shamir Secret Sharing on paper using gfshare diff --git a/src/paper_secret/enpaper.py b/src/paper_secret/enpaper.py index dce7e34..bca74d0 100755 --- a/src/paper_secret/enpaper.py +++ b/src/paper_secret/enpaper.py @@ -73,9 +73,12 @@ def split_encode( txt_file.write_text(lines) if create_text_pdf: - command = ['enscript', '-B', '--margins=24:24:', '-o', str(txt_pdf), '-f', 'Courier@12/12'] + txt_ps = tmpdir / 'txt.ps' + command = ['enscript', '-B', '--margins=24:24:', '-o', str(txt_ps), '-f', 'Courier@12/12'] util.execute_stdin_capture(command, lines.replace('\n', '\n\n\n').encode('UTF-8')) + util.execute_stdin_capture(['ps2pdf', str(txt_ps), str(txt_pdf)]) + if create_qr_codes and merge_qr_codes: command = ['convert'] + [str(qrcode) for qrcode in qrcodes] + [str(qr_pdf)] util.execute_stdin_capture(command)