summaryrefslogtreecommitdiff
path: root/handbook/poky-doc-tools/poky-docbook-to-pdf.in
blob: b56aee49545e0ac13a3da138f1f704d7cb153926 (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/sh
	
if [ -z "$1" ]; then
   echo "usage: [-v] $0 <docbook file>"
   echo
   echo "*NOTE* you need xsltproc, fop and nwalsh docbook stylesheets" 
   echo "       installed for this to work!"
   echo
   exit 0
fi

if [ "$1" = "-v" ]; then
   echo "Version @version@"
   exit 1
fi

BASENAME=`basename $1 .xml` || exit 1
FO="$BASENAME.fo" 
PDF="$BASENAME.pdf"

##
# These URI should be rewritten by your distribution's xml catalog to
# match your localy installed XSL stylesheets.
XSL_BASE_URI="http://docbook.sourceforge.net/release/xsl/current"

xsltproc -o /tmp/titlepage.xsl                                           \
	 --xinclude                                                      \
         $XSL_BASE_URI/template/titlepage.xsl \
         @datadir@/common/titlepage.templates.xml || exit 1

xsltproc --xinclude                    \
	 --stringparam hyphenate false \
	 --stringparam formal.title.placement "figure after" \
	 --stringparam ulink.show 1 \
         --stringparam  body.font.master  9 \
         --stringparam  title.font.master  11 \
         --stringparam draft.watermark.image "@datadir@/common/draft.png" \
         --output $FO               \
         @datadir@/common/poky-db-pdf.xsl    \
	 $1                 || exit 1

fop -c @datadir@/common/fop-config.xml -fo $FO -pdf $PDF       || exit 1

rm -f $FO
rm -f  /tmp/titlepage.xsl

echo
echo " #### Success! $PDF ready. ####"
echo