Skip to content

Commit

Permalink
add actual restore instructions in the document
Browse files Browse the repository at this point in the history
  • Loading branch information
anarcat committed Mar 3, 2023
1 parent 7c3f064 commit fe9933e
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions paperbackup.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,19 @@ def finish_page(pdf, canv, pageno):
outlines.append("")
outlines.append("")
outlines.append("--")
outlines.append("Created with paperbackup.py")
outlines.append("See https://github.com/intra2net/paperbackup/ for instructions")

outlines.append("Created with paperbackup.py from https://github.com/intra2net/paperbackup/")
outlines.append("To restore, either scan this document into a file or use a webcam")
outlines.append("This shell script should restore the content inline")
outlines.append("# zbarimg ends each scanned code with a newline")
outlines.append("# each barcode content begins with ^<number><space>")
outlines.append("# so convert that to \0<number><space>, so sort can sort on that")
outlines.append("# then remove all \n\0<number><space> so we get the originial without newlines added")
outlines.append("/usr/bin/zbarimg '$SCANNEDFILE' --raw -Sdisable -Sqrcode.enable \")
outlines.append(" | sed -e "s/\^/\x0/g" \")
outlines.append(" | sort -z -n \")
outlines.append(" | sed ':a;N;$!ba;s/\n\x0[0-9]* //g;s/\x0[0-9]* //g;s/\n\x0//g'")
outlines.append("# replace 'zbarimg $SCANNEDFILE"' with 'zbarcam' if you have a webcam instead of a scanned document")

# use "enscript" to create postscript with the plaintext
p = subprocess.Popen(
["enscript", "-p"+temp_text_path, "-f", "Courier12",
Expand Down

0 comments on commit fe9933e

Please sign in to comment.