-
-
Save byrongibson/1961409 to your computer and use it in GitHub Desktop.
Script for downloading and combining the chapters of “Ηandbook of applied cryptography” to one pdf file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # downloads all chapters of “handbook of applied cryptography” | |
| # (<http://www.cacr.math.uwaterloo.ca/hac/>) and combines them into one pdf file. | |
| # The resulting file can not be distributed and is only for personal use, as | |
| # per the copyright notice at | |
| # <http://www.cacr.math.uwaterloo.ca/hac/about/copyright-notice.html>. | |
| # Requires ghostscript. | |
| TEMPDIR="/tmp" | |
| # download all chapters | |
| for i in chap{1..15} index references appendix ; do | |
| wget http://www.cacr.math.uwaterloo.ca/hac/about/${i}.pdf | |
| done | |
| # remove the first page from all chapters so page numbers will be correct | |
| for i in *.pdf ; do | |
| gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dFirstPage=2 \ | |
| -sOutputFile=${TEMPDIR}/_${i} $i | |
| done | |
| # combine all chapters to one pdf file | |
| gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite \ | |
| -sOUTPUTFILE=handbook_of_applied_cryptography.pdf \ | |
| ${TEMPDIR}/_chap?.pdf ${TEMPDIR}/_chap??.pdf ${TEMPDIR}/_appendix.pdf \ | |
| ${TEMPDIR}/_references.pdf ${TEMPDIR}/_index.pdf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment