view 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
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