OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]

Subject: Re: [docbook-apps] Noob: Python DocBook to PDF

On Mon, 2007-09-03 at 17:33 -0500, Michael Hipp wrote:
> I'm writing an application in Python that needs to produce reports and 
> printouts. DocBook seems like a great starting point for defining the 
> layouts.
> For better or worse, PDF seems like the way to send printouts to the 
> printer. Are there any other options (when starting from DocBook)?
> Using Python, how do I get from my DocBook XML XSLT files to PDF?

Unless you are using a very well-defined subset of DocBook and have
experience with typesetting into PDF, I would say you don’t.

But let’s back up a bit: DocBook isn’t really good for “defining
layouts.”  It’s good for describing the semantics of techpubs (and some
other textual information).  It may be able to represent your reports,
but if all you want is PDF, DocBook may be an unnecessary diversion.

However, if you want to archive your reports in some reusable form,
DocBook may make sense.

That said, the most straightforward general way to get from DocBook to
PDF is to use XSL, and the most straightforward free way to do that is
with FOP, from the Apache Project.  There are other implementations of
XSL, as well.

However, FOP is written in Java, not Python.  You could use the Python
interface to libxslt to do the transformation part, from DocBook into
XSL-FO, but that doesn’t solve the problem of typesetting into PDF.  And
if you’re going to generate the PDF yourself from within Python, you may
as well not bother with the XSL part.

In short, you need to better define your problem, and not presume that
DocBook or XML are necessarily going to be part of the solution.

Chris Maden, text nerd
“If it’s not an American flag, it’s probably a bomb.”
<URL: http://crism.maden.org/ >
GnuPG Fingerprint: C6E4 E2A9 C9F8 71AC 9724 CAA3 19F8 6677 0077 C319

This is a digitally signed message part

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]