annotate bin/pdfdetextify @ 0:8f7e68d54c6d

initial commit: should be already usable
author markus schnalke <meillo@marmaro.de>
date Thu, 29 Aug 2013 13:58:17 +0200
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
8f7e68d54c6d initial commit: should be already usable
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
1 #!/bin/sh
8f7e68d54c6d initial commit: should be already usable
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
2 #
8f7e68d54c6d initial commit: should be already usable
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
3 # convert pdf to tiff and back to pdf in order to convert text to image
8f7e68d54c6d initial commit: should be already usable
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
4 # writes to stdout
8f7e68d54c6d initial commit: should be already usable
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
5 #
8f7e68d54c6d initial commit: should be already usable
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
6 # depends on: gs, tiff2pdf (libtiff-tools)
8f7e68d54c6d initial commit: should be already usable
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
7
8f7e68d54c6d initial commit: should be already usable
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
8 temp="`mktemp /tmp/${0##*/}.XXXXXX`"
8f7e68d54c6d initial commit: should be already usable
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
9 trap 'rm -f "$temp"' 0 1 2 3 15
8f7e68d54c6d initial commit: should be already usable
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
10
8f7e68d54c6d initial commit: should be already usable
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
11 for i do
8f7e68d54c6d initial commit: should be already usable
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
12 # echo "processing $i"
8f7e68d54c6d initial commit: should be already usable
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
13 gs -q -dNOPAUSE -dBATCH -sPAPERSIZE=a4 -dPDFSETTINGS=/prepress \
8f7e68d54c6d initial commit: should be already usable
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
14 -r300 -o "$temp" -sDEVICE=tiffgray -sCompression=lzw "$i"
8f7e68d54c6d initial commit: should be already usable
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
15 tiff2pdf -z "$temp"
8f7e68d54c6d initial commit: should be already usable
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
16 done