File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other Open Source Projects and the fly likes docbook & FOP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "docbook & FOP" Watch "docbook & FOP" New topic
Author

docbook & FOP

Arnold Reuser
Ranch Hand

Joined: Nov 20, 2003
Posts: 196
I experience a lot of troubles when I combine docbook with FOP.
A real simple docbook example like :


Turns out in a lot of error code.



I know FOP is the problem. But is there an open source solution so that docbook will generate pdf without all of these error messages?
Do you know if a commercial solution like XEP can handle these problems?
[ August 06, 2004: Message edited by: Arnold Reuser ]
Arnold Reuser
Ranch Hand

Joined: Nov 20, 2003
Posts: 196
Currently I've implemented the solution with FOP & Docbook in a neat and succesful way. Not all features of xsl-fo are implemented in FOP, so this will result in a lot of errors. But none of them are blocking the process and the the result still looks great. Therefore XEP wasn't necessary.
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Would you be interested in writing up your "setup" for the rest of us to mimick?


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Arnold Reuser
Ranch Hand

Joined: Nov 20, 2003
Posts: 196
Yes ofcourse I would like to share this knowledge.
Just start by asking a smart question ;-)
Where can I post the answer?
[ September 29, 2004: Message edited by: Arnold Reuser ]
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Well, I've tried to set up a "text-based" authoring environment from which I could generate PDFs with a single command etc. but I've never really managed to finish that project (I can't remember where I stumbled with FOP or the stylesheets but there was some problem that I didn't have the energy to solve). So, I was wondering if you would be interested in writing a little tutorial along the lines of "Quickstart to Generating PDFs from Docbook"...
Arnold Reuser
Ranch Hand

Joined: Nov 20, 2003
Posts: 196
Someone else already wrote a nice and short tutorial :

http://www.sagehill.net/docbookxsl/InstallingAnFO.html

This gives you more than enough information about how to get
started with FOP. When you've read this one page tutorial and all you've downloaded all the necessary jars.
The next step must be taken : download docbook :

http://prdownloads.sourceforge.net/docbook/docbook-xsl-1.66.1.zip?download

unzip it somewhere and remember that /fo/docbook.xsl is the most interesting file to remember.

When you're done write some run.bat that will do all the hard work for you. While you can drink, relax or sleep a little bit more than you're used to do. When you're a linux adapt, just rewrite the following run.bat file that I've written :



Did you remember the path to docbook.xsl? My path is : ../fo/docbook.xsl
Also just put the jars on your classpath. My jars are in lib/ , for example lib/fop.jar

The last part is writing some docbook file.
Therefore I've written a small docbook file.



So give it a try!
When you're done and succesful, your almost done.
Because this is just a bat file processing some docbook file.
But that is not a real life example.
The java code that can do the job is :



Well and when you did understand every part of it.
And you've realized that the performance of the code isn't very good and you can rewrite it in a nice way.
Start reading a quick reference :

http://www.csis.gvsu.edu/~adams/XML/docbook_quickref.html

Or start reading :

http://www.sagehill.net/book-description.html

Welcome to the real world ;-)
[ September 30, 2004: Message edited by: Arnold Reuser ]
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Thanks Arnold!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: docbook & FOP