This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
Re: XSL print StyleSheets
- To: docbook-apps at lists dot oasis-open dot org, harry at inpharmatica dot co dot uk
- Subject: Re: DOCBOOK-APPS: XSL print StyleSheets
- From: Bob Stayton <bobs at sco dot com>
- Date: Wed, 3 May 2000 2:00:40 PDT
> From: Matthew Harrison <harry@inpharmatica.co.uk>
>
> 3. But I'm still not in print by this route. 'fo' stylesheets produce fo (I'm
> learning as I go here :?), not tex like the DSSSL print stylesheets
> and don't quite get me printing. I'm sure I've missed something.
> How do I get from fo to tex? (or to print by any route, apart from
> printing html from a browser or using html2ps)?
The missing piece is a formatting object processor.
I have successfully used FOP from the Apache
XML project <http://xml.apache.org> to produce
PDF from DocBook XML. It's written in Java 1.1
and can be used standalone or as a servlet.
You use XT or equivalent to generate the fo file,
and then FOP to convert fo to PDF.
Here is my simple shell script that does that.
Your directory paths may vary.
#------------snip-----------
#!/bin/sh
# xml2pdf - convert Docbook XML file into PDF file
# Uses apache fop.
# Set some env variables
JAVABIN=/usr/java/bin
JAVALIB=/usr/java/lib
LOCAL=/usr/local/lib
STYLESHEET=$LOCAL/stylesheets/docbook/fo/docbook.xsl
JC=$LOCAL/javaclasses
export JAVABIN JAVALIB SCODOC JC
CLASSPATH=$JAVALIB/classes.zip:$JC/xt.jar:$JC/xp.jar:$JC/sax.jar:$JC/fop.jar
export CLASSPATH
# Convert from xml to formatting object tree file using XT:
BASE=`basename $1 .xml`
$JAVABIN/java com.jclark.xsl.sax.Driver $1 $STYLESHEET > $BASE.fo
# Convert the fo tree to pdf using apache FOP:
$JAVABIN/java org.apache.fop.apps.CommandLine $BASE.fo $BASE.pdf
#------------snip-----------
Have fun.
bobs
Bob Stayton 400 Encinal Street
Publications Architect Santa Cruz, CA 95060
Technical Publications voice: (831) 427-7796
The Santa Cruz Operation, Inc. fax: (831) 429-1887
email: bobs@sco.com