G. Milde | 29 Mar 16:14
Picon

Re: Alternatives for reST -> PDF

On 28.03.06, Nick Moffitt wrote:
> G. Milde:

Wanted: Alternatives for reST -> PDF

> > > What alternatives are there? Can I render from reST to PDF via some
> > > other, more reliable route, avoiding (La)TeX and all its annoyances?

What I would like to see is a script that does the reST2PDF conversion
with one command, similar to rst2html or rst2latex.

pdflatex
--------

My first suggestion was a wrapper script around pdflatex that would
care for the necessary preparation, run as many times as needed and
clean up afterwards thus bypassing the most obvious annoyances of LaTeX.

There is a script to facilitate pdf creation at
http://developer.berlios.de/projects/tex2pdf/
that could serve as a base.

> > If you care for best layout quality, LaTeX might still be the
> > ultimative choice. 
> 
> With respect, LaTeX hasn't been the king of layout in a long time.  It
> works most of the time, true, and ten years ago it was a jewel in the
> Free Software crown, but it has shown its age since then.  It's pretty
> warty.  I'm kind of irritated at the person who thought that simply
> suggesting pdflatex or whatever would solve all of LaTeX's warts and
> misfeatures.

I do not suggest that LaTeX is up to date or has a well designed user
interface. But I still consider the output of LaTeX of excellent
quality, especially in the field of science and math.

Scribus
-------

> One thing that might turn out useful would be a Scribus-writer.  Scribus
> also uses an XML format, so it may even be possible to play goofy XSLT
> games on the docutils internal XML format stuff.  
> 
> One drawback seems to be that Scribus currently doesn't operate
> headless.

Inkscape
--------

> I may have been thinking of Inkscape (which I've used to render
> script-generated SVG into PNG).

Inkskape could be an option too, as it can convert SVG to ps (and ps to
pdf is easy with Ghostscripts ps2pdf). (You do not really want to
produce PDF from PNG, will you?)

You still need some script to convert reST (or XML) to SVG.

Prince
------

An interesting alternative is http://www.princexml.com/, converting HTML
+ CSS to PDF. It is not free. The site offers a trial version for
download.

CSSToXSLFO and FOP
------------------

CSSToXSLFO (http://www.re.be/css2xslfo/) is a utility which can convert an
XML document, together with a CSS2 style sheet, into an XSL-FO document,
which can then be converted into PDF, PostScript, etc. with an
XSL-FO-processor. It has special support for the XHTML vocabulary,
because that is the most obvious language it would be used for. The tool
has a number of page-related extensions. It also comes with an API in the
form of an XML filter.

The XSL-FO to PDF conversion could be done with the free tool FOP
from Apache http://xml.apache.org/fop/.

ReportLab
---------

The ReportLab Open Source PDF library (http://www.reportlab.org/) is a Python
library which could be used to produce a "native" PDF writer.

Günter

--

-- 
Milde ife.et.tu-dresden.de

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642

Gmane