From: Christian Neukirchen Date: 2005-11-13T01:24:20+09:00 Subject: Re: DocBook to PDF Bob Hutchison writes: > On Nov 11, 2005, at 8:01 PM, Hal Fulton wrote: > >> I'm wanting to do some docbook to pdf conversion. >> >> I assume the "right" way would be some combination >> of REXML and PDF::Writer. >> >> Anyone done anything like this? >> >> Ideally I'd like to be able to tweak a few things >> such as margins and page size without changing >> anything else... >> >> Ideas welcome. > > My first thought is Holy Crap! Really, I've got a kid about that age :-) > > The typical XML way to do this is DocBook -> XSL:FO -> pdf because > you'll be able to use Norm Walsh's stuff. If you do this and you have > input documents bigger than, say, two pages, you'll be wanting the > *fastest* XML processors you can get. I did this a couple of years > ago and found libxml2 and libxslt2 the way to go. Getting a good > XSL:FO processor was quite a trick then, and I have not been keeping > up to date, so keep that in mind. The only free one that I could find > was the Apache FOP processor, and it wasn't all that good > (incomplete). There are a couple of commercial processors that are > apparently very good, but I wasn't willing to spend a couple hundred > bucks on them. Have you tried passiveTeX? http://www.tei-c.org.uk/Software/passivetex/ (And even if you don't need it, acknowledge that major hack. :-P) > An alternative that is worked quite well was to use the SGML > processors for DocBook. DSSSL, anyone? > As I said, I've not been keeping up, but apparently both the Apache > XML processors and Saxon have become much faster in the last couple > of years. Both of those are Java. Unfortunately I don't think Ruby > has a remote chance of being useful as an XML processor for this kind > of application until Ruby gets much faster. It all depends on the libs you use. If you go REXML and start sleeping on your keyboard, no wonder; but there are bindings to libxml2 and libxslt too... > Are you committed to DocBook? If not you should have a look at DITA > (from IBM), and consider latex/contex or one of the groff macro > packages (like om (mom)). Texinfo may be a choice for multi-format output too. > I'm having some fun with publicon from > Wolfram these days (it reminds me of FrameMaker but runs on OS/X (and > Windows, linux coming, maybe) and can generate HTML, XML, and latex > output). If publicon works out (I'm using it to document a ruby > project I'll be open sourcing soon, and a couple of things for work) > I'll be sticking with that. Publicon looks very promising, thanks for mentioning that. > Cheers, > Bob -- Christian Neukirchen http://chneukirchen.org