Re: Converting a web to pdf or ..‍

John J. Lee jjlee at reportlab.com
Wed Jul 19 17:39:01 EDT 2006


"Bayazee" <bayazee at gmail.com> writes:

> Hi ,
> I have a web site and i want to write a perogram with python that my
> users can convert custom web page of site to pdf (or other type :jpeg,
> doc,odt,or...) and download it . i dont want only convert text . it is
> be very good to i can don it for both text and images ... similar to
> web page ... can i do it with  ReportLab ??

Not without some hard work, no.  The problem is not the PDF or bitmap
generation, it's rather the rendering of the HTML, CSS, images
etc. into *any* format: it's a big job that only browsers really do
well, AFAIK.

I seem to recall people posting here about this problem in the past --
try Google Groups.  I imagine most web browsers can generate
thumbnails, so a larger bitmap shouldn't be a problem.  Browsers are
rather "heavyweight", though, and not ideal for running on a server.

If you're on Linux (or maybe even Windows soon, now that Qt4/win is
GPLed), you could maybe use DCOP to get the Konqueror browser to spit
out images without dragging in too much UI.

Google will find more:

http://www.google.co.uk/search?q=thumbnail+web+page+python


John



More information about the Python-list mailing list