Converting HTML to PDF using Python?

O

Oltmans

Hi Python superstars,

Guys, any ideas on how to convert HTML files to PDF files? Or as an
alternative, how to convert HTML files to an image file(jpeg/png/etc)?
Ideally, the converted PDF/Image file should like exactly like the way
HTML file looks in the browser.

I really have no idea about this so I will really appreciate all the
help. Thanks in advance and kindly pardon my ignorance.

Thanks,
Oltmans
 
C

CM

Hi Python superstars,

Guys, any ideas on how to convert HTML files to PDF files? Or as an
alternative, how to convert HTML files to an image file(jpeg/png/etc)?
Ideally, the converted PDF/Image file should like exactly like the way
HTML file looks in the browser.

I really have no idea about this so I will really appreciate all the
help. Thanks in advance and kindly pardon my ignorance.

Thanks,
Oltmans

http://lmgtfy.com/?q=python+html+to+pdf
 
T

Terry Reedy

How an HTML file looks in *a* (not *the*) browser depends on the
browser, its settings, and window size. That is both a virtue and a
reason for the invention of pdf format.
 
G

Grant Edwards

Guys, any ideas on how to convert HTML files to PDF files?

os.system("w3m -dump %s | a2ps -B --borders=no -o - | ps2pdf - %s" % (infile,outfile))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,989
Messages
2,570,207
Members
46,783
Latest member
RickeyDort

Latest Threads

Top