Group: comp.lang.python


Subject: How to generate pdf file from an html page??
From: Grant Edwards
Date: 12/17/2007 3:42:38 PM
On 2007-12-16, abhishek <guptaabhishek1983@gmail.com> wrote: > Hi everyone, I am trying to generate a PDF printable format file from > an html page. Is there a way to do this using python. If yes then > which library and functions are required and if no then reasons why it > cant be done. Here's one way: ------------------------------html2pdf.py---------------------------------------- #!/usr/bin/python import os,sys inputFilename,outputFilename = sys.argv[1:3] os.system("w3m -dump %s | a2ps -B --borders=no | ps2pdf - %s" % (inputFilename,outputFilename)) --------------------------------------------------------------------------------- -- Grant Edwards grante Yow! Someone in DAYTON, at Ohio is selling USED visi.com CARPETS to a SERBO-CROATIAN

Subject: How to generate pdf file from an html page??
From: Grant Edwards
Date: 12/19/2007 3:31:43 PM
On 2007-12-19, abhishek <guptaabhishek1983@gmail.com> wrote: >> > Hi everyone, I am trying to generate a PDF printable format file from >> > an html page. Is there a way to do this using python. If yes then >> > which library and functions are required and if no then reasons why it >> > cant be done. >> >> Here's one way: >> >> ------------------------------html2pdf.py----------------------------------------- >> #!/usr/bin/python >> import os,sys >> >> inputFilename,outputFilename = sys.argv[1:3] >> >> os.system("w3m -dump %s | a2ps -B --borders=no | ps2pdf - %s" % (inputFilename,outputFilename)) >> ---------------------------------------------------------------------------------- > hi grant have tried the command it resulted in the following errors > > sh: a2ps: not found You'll need to install a2ps. It's available as a standard package for all the distros I've ever used. > ESP Ghostscript 815.04: **** Could not open the file /home/samba/users/ > Abhishek/newTemplate.pdf . > **** Unable to open the initial device, quitting. > 256 Either your ghostscript installation is broken, or you've tried to use an output path/file that's not writable. I suspect the latter. -- Grant Edwards grante Yow! Is it 1974? What's at for SUPPER? Can I spend visi.com my COLLEGE FUND in one wild afternoon??

Subject: How to generate pdf file from an html page??
From: Grant Edwards
Date: 12/20/2007 3:54:47 PM
On 2007-12-20, MonkeeSage <MonkeeSage@gmail.com> wrote: > This looks a little better for me ... | a2ps -B --borders=0 -- > columns=1 -f 10.0 | ... Right. I forgot that I've adjusted my a2ps defaults to using a single column and a readable font size instead of the standard 2-up tiny-font mode. -- Grant Edwards grante Yow! When you get your at PH.D. will you get able to visi.com work at BURGER KING?