Adds title

This commit is contained in:
Nemo 2020-02-01 03:06:15 +05:30
parent bc8b4b4f2b
commit d192c63a3c
2 changed files with 18 additions and 4 deletions

View File

@ -2,8 +2,8 @@
COVER_URL=https://www.cl.cam.ac.uk/~rja14/Papers/SEv3-cover.jpg
wget --timestamping "$COVER_URL" --output-document cover.jpg
convert cover.jpg cover.pdf
# wget --timestamping "$COVER_URL" --output-document cover.jpg
# convert cover.jpg cover.pdf
wget --timestamping --input-file "urls.txt"
@ -16,8 +16,17 @@ pdftk cover.pdf SEv3-pref-May16.pdf SEv3-ch1-dec18.pdf \
SEv3-ch18-dec18.pdf SEv3-ch19-dec18.pdf SEv3-ch26-dec18.pdf \
SEv3-bib-jan7.pdf cat output temp.pdf
echo "InfoBegin" > meta.txt
echo "InfoKey: Title" >> meta.txt
echo "InfoValue: Security Engineering — Third Edition" >> meta.txt
echo "InfoBegin" >> meta.txt
echo "InfoKey: Author" >> meta.txt
echo "InfoValue: Ross Anderson" >> meta.txt
## We start from page 2 because first is cover and it is not included in urls.txt
PAGE_NUM=2
echo "BookmarkBegin" > meta.txt
echo "BookmarkBegin" >> meta.txt
echo "BookmarkTitle: Cover" >> meta.txt
echo "BookmarkLevel: 1" >> meta.txt
echo "BookmarkPageNumber: 1" >> meta.txt
@ -33,7 +42,6 @@ do
echo "BookmarkLevel: 1" >> meta.txt
echo "BookmarkPageNumber: $PAGE_NUM" >> meta.txt
PAGE_NUM=$((PAGE_NUM+PAGES))
echo "Current page is $PAGE_NUM"
done < "$input"
pdftk temp.pdf update_info meta.txt output security-engineering-3rd-edition.pdf

View File

@ -1,3 +1,9 @@
InfoBegin
InfoKey: Title
InfoValue: Security Engineering — Third Edition
InfoBegin
InfoKey: Author
InfoValue: Ross Anderson
BookmarkBegin
BookmarkTitle: Cover
BookmarkLevel: 1