Skip to content

Commit

Permalink
add bash script for TOC
Browse files Browse the repository at this point in the history
  • Loading branch information
igordejanovic committed Jan 15, 2024
1 parent 506dd04 commit 4bd1a79
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions readcode-toc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh
# Create TOC for the given pdf produced by readcode
# Requires https://krasjet.com/voice/pdf.tocgen
if [ "$#" -ne 1 ]; then
echo "Creates pdf with TOC from the pdf produced by readcode"
echo "Usage: $0 <input pdf>"
else
pdftocgen $1 <<EOF | sed -e '/"File:"/d' | sed -e 's/"File: /"/' | pdftocio -o ${1%.pdf}-toc.pdf $1
[[heading]]
level = 1
greedy = true
font.size = 14
EOF
fi

0 comments on commit 4bd1a79

Please sign in to comment.