Docbook and Apache FOP
October 2, 2009 | In Uncategorized |I have taken up Docbook again. It was too much configuration and fixing when I tried it a few years ago. But now I found a Maven plugin that makes it really easy. Fonts go in one directory, custom XSL in another, images and docbook files in a third. Then all I have to do is
mvn clean generate-resources pre-site
to generate a shiny PDF in target. The plugin is called docbkx-maven-plugin.
This was actually close to documentation editing nirvana. But I have a really annoying issue. If I include raster files they get rendered in the wrong resolution. FOP is shoing them as larger and pixelized. I thought there might be something wrong with my settings or the plugin so I tried a commercial offering from OxygenXml.com. They also use Apache FOP as the default FO processor.
They replied to my support request (really good support, and it was only pre-sale questions):
It is a problem of the FOP processor which scales the images to a larger size ignoring the actual image size and the width and height set by the user. You should use a different FO engine like XEP for RenderX. […]
RenderX costs $360.
I have googled a lot and this seems to be a really old issue in Apache FOP. Anyone knows if there is a solution? Are they working on the issue?
2 Comments »
RSS feed for comments on this post.
You shouldn’t set the height of your imageobject, there some bizarre reason why that I don’t remember. Just set the width (in cm or mm) you want it to have in your PDF/HTML.
The full resolution version is incorporated in the PDF, so if you zoom it on-screen, or print on a high resolution printer, you get all the detail while retaining the right proportions.
For HTML output the actual files wont be scaled, but the size attributes are set in HTML.
Comment by Arvid — October 2, 2009 #
I’m mostly concerned about reading the PDF on screen. So what I want is to have the PNG image included in 72 DPI with the same size as if I view it in a picture viewer.
Was this what you meant:
<imagedata contentwidth="396" fileref="handshake/handshake_db.png" format="PNG"/>Tried it and it still get enlarged and ugly.
Comment by marvi — October 2, 2009 #