diff options
Diffstat (limited to 'handbook/poky-doc-tools/poky-docbook-to-pdf.in')
-rw-r--r-- | handbook/poky-doc-tools/poky-docbook-to-pdf.in | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/handbook/poky-doc-tools/poky-docbook-to-pdf.in b/handbook/poky-doc-tools/poky-docbook-to-pdf.in new file mode 100644 index 0000000000..cc999ab995 --- /dev/null +++ b/handbook/poky-doc-tools/poky-docbook-to-pdf.in | |||
@@ -0,0 +1,44 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | if [ -z "$1" ]; then | ||
4 | echo "usage: [-v] $0 <docbook file>" | ||
5 | echo | ||
6 | echo "*NOTE* you need xsltproc, fop and nwalsh docbook stylesheets" | ||
7 | echo " installed for this to work!" | ||
8 | echo | ||
9 | exit 0 | ||
10 | fi | ||
11 | |||
12 | if [ "$1" = "-v" ]; then | ||
13 | echo "Version @version@" | ||
14 | exit 1 | ||
15 | fi | ||
16 | |||
17 | BASENAME=`basename $1 .xml` || exit 1 | ||
18 | FO="$BASENAME.fo" | ||
19 | PDF="$BASENAME.pdf" | ||
20 | |||
21 | xsltproc -o /tmp/titlepage.xsl \ | ||
22 | --xinclude \ | ||
23 | /usr/share/xml/docbook/stylesheet/nwalsh/template/titlepage.xsl \ | ||
24 | @datadir@/common/titlepage.templates.xml || exit 1 | ||
25 | |||
26 | xsltproc --xinclude \ | ||
27 | --stringparam hyphenate false \ | ||
28 | --stringparam formal.title.placement "figure after" \ | ||
29 | --stringparam ulink.show 1 \ | ||
30 | --stringparam body.font.master 9 \ | ||
31 | --stringparam title.font.master 11 \ | ||
32 | --stringparam draft.watermark.image "@datadir@/common/draft.png" \ | ||
33 | --output $FO \ | ||
34 | @datadir@/common/poky-db-pdf.xsl \ | ||
35 | $1 || exit 1 | ||
36 | |||
37 | fop -c @datadir@/common/fop-config.xml -fo $FO -pdf $PDF || exit 1 | ||
38 | |||
39 | rm -f $FO | ||
40 | rm -f /tmp/titlepage.xsl | ||
41 | |||
42 | echo | ||
43 | echo " #### Success! $PDF ready. ####" | ||
44 | echo \ No newline at end of file | ||