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]
Other format: [Raw text]

Re: [docbook-apps] Converting DocBook to PDF using PHP


XSLT cannot generate PDF output directly. It can generate XSL:FO (an XML format), which can then be transformed into PDF (a binary format) by an XSL:FO processor such as FOP (Java app). If it really must be on-the-fly, then I'd suggest generating the XSLFO on the fly, saving that to a file via PHP, then running the FOP command line tool via PHP's local-shell exec methods (there are 2 or 3 I believe) to generate a PDF file, which you then read off the disk and return via PHP. I've not done binary files with PHP myself, I'm afraid, so I can't help you on the syntax there. It will probably also be painfully slow this way.

Are you sure you can't do off line scheduled generation?

Noah Slater wrote:
Hello,

I am still trying to grok DocBook, but I am having a little trouble
figuring out one thing.

I have a file called docbook.xml and another file called docbook.xsl
which I am using to generate HTML output.

I am generating the HTML using PHP's XSL extension. Please do not
think this post is about PHP, because it's not - I have no problem
with PHP.

The way the extension works is quite simple. It takes a XML file (in
this case, a DocBook file) and applies a XSLT file to get some output.
It's as simple as that.

Now, onwards to my query. Is it possible with this simple model to
transform my document to PDF?

I have looked for hours on the web at many sites, but they all seem to
focus on command line tools (such as tex and LaTeX etc) for the
transformations. I do not want to do this, as the target application
of all this is a simple website that can offer PDF files generated on
the fly from DocBook files.

Does anyone have any ideas or pointers? Is it simply a matter of
getting the right XSL file that can do this for me? If so, are there
any free (as in speech) one's on the web?

Thanks guys, your help is greatly appreciated!

Noah

-- Larry Garfield AIM: LOLG42 larry@garfieldtech.com ICQ: 6817012

"If nature has made any one thing less susceptible than all others of exclusive property, it is the action of the thinking power called an idea, which an individual may exclusively possess as long as he keeps it to himself; but the moment it is divulged, it forces itself into the possession of every one, and the receiver cannot dispossess himself of it." -- Thomas Jefferson


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