summaryrefslogtreecommitdiff
path: root/graphics/pdf2html
blob: 1e5350117cfad15f83945835384f9fe7e440925d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash

filter='./pbm2png'
ghostscript='gs'
basename='letters'
titlestring='Letters generated for Links'
bottom=''
pageoffset='0'

PATH=$PATH:./
hdpi=`expr $hundred_dpi '*' 17 '/' 100`
vdpi=`expr $hundred_dpi '*' 15 '/' 100`
start=$2
if [ "$start" = "" ]; then
 start=0
fi
start1=`expr $start + 1`

pname="/tmp/.pdf2html_pipe_$$"
function delete () { rm -f $pname; }
trap delete SIGINT

rm -f $pname
mkfifo $pname
$ghostscript -q -dFirstPage=$start1 -dNOPAUSE -dBATCH -sDEVICE=pbmraw -sPAPERSIZE=a4 -sOutputFile="$pname" -r"$hdpi"x"$vdpi" $1 &
$filter "$hundred_dpi" "$basename" "$titlestring" "$bottom" "$pageoffset" "$pname" $start
rm -f $pname