Debian Codegraph @

tools/imagefrom

raw
1 #!/bin/sh
2 #
3 # Build some image/snapshot of parts of the manual. The XML elements to shoot
4 # are specified by their unique identifier (@id)
5 #
6 basedir=`dirname $0`
7 dblatex="$basedir/../scripts/dblatex"
8 xsl="$basedir/getsubset.xsl"
9
10 if [ $# -lt 2 ]; then
11 echo "`basename $0` file.xml id1 [id2 ...]"
12 exit 1
13 fi
14
15 # The XML input file
16 file="$1"
17 shift
18
19 echo $*
20
21 for id in "$@"; do
22 imgfile="img-$id"
23 $dblatex -o $imgfile.pdf -P extractid=$id -p $xsl $file
24 convert -units PixelsPerInch -density 144x144 -trim $imgfile.pdf $imgfile.png
25 rc=$?
26 if [ "$rc" = "0" ]; then
27 echo "'$imgfile.png' successfully built"
28 rm $imgfile.pdf
29 fi
30 done