File: imagefrom

package info (click to toggle)
dblatex 0.3.12py3-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 12,684 kB
  • sloc: xml: 102,889; python: 8,259; makefile: 119; sh: 48
file content (30 lines) | stat: -rwxr-xr-x 645 bytes parent folder | download | duplicates (9)
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
29
30
#!/bin/sh
#
# Build some image/snapshot of parts of the manual. The XML elements to shoot
# are specified by their unique identifier (@id)
#
basedir=`dirname $0`
dblatex="$basedir/../scripts/dblatex"
xsl="$basedir/getsubset.xsl"

if [ $# -lt 2 ]; then
  echo "`basename $0` file.xml id1 [id2 ...]"
  exit 1
fi

# The XML input file
file="$1"
shift

echo $*

for id in "$@"; do
  imgfile="img-$id"
  $dblatex -o $imgfile.pdf -P extractid=$id -p $xsl $file
  convert -units PixelsPerInch -density 144x144 -trim $imgfile.pdf $imgfile.png
  rc=$?
  if [ "$rc" = "0" ]; then
    echo "'$imgfile.png' successfully built"
    rm $imgfile.pdf
  fi
done