#!/bin/sh # # Pdf.sum - takes a filename as the first argument. # # Usage: Pdf.sum filename # # Using Adobe's Acrobat: # Create a postscript format file from the input. # Pass that filename to the postscript summarizer. # #if [ -z $TMPDIR ]; then # TMPDIR=/tmp #fi # #acroread -toPostScript -pairs $1 $TMPDIR/$$.ps #PostScript.sum $TMPDIR/$$.ps #rm -f $TMPDIR/$$.ps # # Using Derek B. Noonburg's xpdf: # # pdftotext fails to process some pdf files correctly and # creates huge text files. # # Use this if your Pdf files are correctly processed by xpdf. # #pdftotext $1 - | wrapit "Partial-Text" # # Use this if you have GNU textutils installed. # #pdftotext $1 - | head -c 10485760 | wrapit "Partial-Text" # # This should work for all systems. # pdftotext $1 - | tr "\t" " " | tr -s " \n\r\f" | fmt -s -w 160 | head -n 65000 | wrapit "Partial-Text"