This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: XSL print StyleSheets


> 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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]