Re: Commandline tool html2pdf



Hi;

Le Mon, 20 Apr 2009 17:39:39 +0200,
"Stephen R. van den Berg" <srb cuci nl> a écrit :
> I have scraped the Internet (a lot) looking for a tool that fits my
> needs. So far the things I've come up with are programs like
> xhtml2pdf, htmldoc and html2ps.
> Of these html2ps (latest update from 2005) still seems to be the best
> choice. Sadly, it's a gross hack as a Perl script that doesn't really
> parse anything, it just transforms the text using appropriate sloppy
> regexp scanners, and then uses things like TeX to actually generate
> part of the output.
> 
> It's not even that bad (I guess that's due to TeX's amazing
> capabilities), but it lacks proper CSS support.  Further extending
> this hack to actually to start support CSS seems to be the wrong
> avenue.
> 
> So I tried approaching it from a different angle, and started looking
> for as simple as possible webbrowsers, hoping to find one which has a
> commandline option to actually load an HTML page and subsequently
> render it into multipage Postscript or PDF without ever opening up a
> GUI.
> 
> Suffice it to say, that doesn't seem to exist.
> Now the question is, can epiphany be coerced into performing this
> task? I can't imagine I'm the first person to actually have this
> problem. What would it take to support something like this?
> I'm willing to contribute code, if I know it is likely to be accepted.

I have written a tool that uses Gecko/Xulrunner to (almost) do this:

	git clone git://git.gnome.org/gnome-web-photo

It shows no UI but needs an X server (but xvfb should work).

I say "almost" because it currently only prints to PostScript; but
adding a PDF option should be straightforward. It just needs a new
option and set a flag in the print code forwarding the setting to
xulrunner.

	Christian



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]