Ubuntu 8.10
sudo apt-get install sun-java6-jdk
sudo update-java-alternatives -s java-6-sun
check Java version:
java -version
result:
java version "1.6.0_10"
Java(TM) SE Runtime Environment (build 1.6.0_10-b33)
Java HotSpot(TM) Client VM (build 11.0-b15, mixed mode, sharing)
sudo apt-get install fop xsltproc
sudo apt-get install docbook docbook-xsl docbook-dsssl
xsltproc -o output.html --stringparam html.stylesheet main.css /usr/share/xml/docbook/stylesheet/nwalsh/xhtml/docbook.xsl input.xml
fop -xsl /usr/share/xml/docbook/stylesheet/nwalsh/fo/docbook.xsl -xml input.xml -pdf output.pdf
If you want to another language except Englich, you need to set fonts configuration.
fop -c config.xml -xsl config.xsl -xml input.xml -pdf output.pdf
For example, you want to use VL Gothic(Japanese):
fop-ttfreader /usr/share/fonts/truetype/vlgothic/VL-PGothic-Regular.ttf VL-PGothic-Regular.xml
VL Gothic is installed by
sudo apt-get install ttf-vlgothic