view bin/pdfdetextify @ 1:6ea97e3f7cb5 default tip

ignore log and upload, because they change in a live setup
author markus schnalke <meillo@marmaro.de>
date Thu, 29 Aug 2013 13:59:09 +0200
parents 8f7e68d54c6d
children
line wrap: on
line source

#!/bin/sh
#
# convert pdf to tiff and back to pdf in order to convert text to image
# writes to stdout
#
# depends on: gs, tiff2pdf (libtiff-tools)

temp="`mktemp /tmp/${0##*/}.XXXXXX`"
trap 'rm -f "$temp"' 0 1 2 3 15

for i do
	# echo "processing $i"
	gs -q -dNOPAUSE -dBATCH -sPAPERSIZE=a4 -dPDFSETTINGS=/prepress \
			-r300 -o "$temp" -sDEVICE=tiffgray -sCompression=lzw "$i"
	tiff2pdf -z "$temp"
done