3 # This script runs from inside a folder that has one or more .odts in it.
4 # You need the following packages installed:
11 echo "Step 1: convert all odts in this folder to pdf"
15 # -sPAPERSIZE=a4 -dFIXEDMEDIA
17 echo "Step 2: convert all pdfs in this folder to ps"
24 echo "Step 3: scale all ps in this folder from A4 to A5"
27 do psresize
-PA4 -pA5 $i "scaled_"$i;
30 echo "Step 4: convert all scaled ps back to pdf"
32 for i
in "scaled_"*.ps
;
33 do ps2pdf
-sPAPERSIZE=a5
$i;
36 echo "Step 5: remove all ps"
42 echo "Step 6: put all scaled pdfs together in brief.pdf, gedicht.pdf and verhaal.pdf"
45 pdftk
*.pdf
cat output love
/love.pdf
;
46 pdftk scaled_brief_
*.pdf
cat output love
/brief.pdf
;
47 pdftk scaled_verhaal_
*.pdf
cat output love
/verhaal.pdf
;
48 pdftk scaled_gedicht_
*.pdf
cat output love
/gedicht.pdf
;
50 echo "Step 6b: convert brief.pdf, gedicht.pdf and verhaal.pdf to grayscale + PDF1.3"
54 do gs
-sOutputFile="gray_"$i -sDEVICE=pdfwrite
-sColorConversionStrategy=Gray
-dProcessColorModel=/DeviceGray
-dCompatibilityLevel=1.3 -dNOPAUSE -dBATCH $i < /dev
/null
;
58 echo "Step 7: remove all scaled pdfs"
60 for i
in "scaled_"*.pdf
;