Docbook publishing as PDF with bookmarks on Windows

Just a note to remember that Docbook publishing on Windows isn’t as easy as on Linux, but still not that hard :

  1. Download FOP and Saxon
  2. Create a stylesheet fop.xsl :
    <?xml version="1.0" encoding="utf-8"?>
    <xsl:param name="paper.type" select="'A4'"/>
    <xsl:param name="fop.extensions" select="0"/>
    <xsl:param name="fop1.extensions" select="1"/>
  3. Create a batch :
    saxon.jar -o GuideFoo.xml E:\dev\dbk\fop.xsl
    fop.bat -fo -pdf GuideFoo.pdf

Notes :

  • The fop extension defined in the XSL will allow bookmarks creation
  • If you have images you may have to install JIMI, JAI for FOP too.
  • It supposes that you have an good Internet connection and no proxy. Otherwise, you can download the Docbook XSL and for proxy, add “java -DproxySet=true -DproxyPort=3128 -jar”
  • Some uses Ant to publish Docbook, it is very efficient. Makefile is also an option, there are examples in Docbook XSL distribution.
  • Saxon isn’t the only choice, xsltproc may be faster, specially if you don’t use Saxon’s extensions.

One Response to Docbook publishing as PDF with bookmarks on Windows

  1. It could also be done using the Maven Docbkx Plugin, if you are used to Maven. Using the Maven Docbkx Plugin, you would simply have to add this to the plugins section of your pom.xml file:



    The latest version (that hasn’t been released yet though) also generates PDF, using FOP 0.20.5. Parameters are not specified by adding your own XSLT customization layer, but instead by using plugin configuration parameters. (See for an overview of all paremeters. Note the one-to-one correspondence with the XSLT params.)

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: