views:

97

answers:

4

I need to convert HTML documents into PDF format. Can u help me?

+1  A: 

There's a GPL/Commercial licensed HTML to PDF converter at http://www.xhtml2pdf.com/.

It also may pay to consider using HTMLDOC via the command line using os.system or something similar (http://www.htmldoc.org/)

See also windows prebuilt binaries for Windows at http://htmldoc-binaries.org/

David Morrissey
+1  A: 

Report lab could be helpful.

http://www.reportlab.com/software/opensource/

in70x
+1  A: 

When my co-authors and I wrote Python Web Development with Django, we used a tool called Markdown to output the text of the book into HTML. we then piped that output to the html2ps tool (the Perl one not the PHP one) then finally piped the output of that into the GhostScript ps2pdf tool that gave us the PDF files we needed.

keep in mind that we used a toolchain where Python was involved only in the beginning via the Markdown port called Python-Markdown. if you want to do it entirely programmatically, ReportLab may be your only option.

hope that helps! if you curious as to how open source tools are used to write books (rather than being forced to use a proprietary word processor, i gave a talk on this very subject at the PyCon 2010 conference in Feb). http://us.pycon.org/2010/conference/schedule/event/69/ ... sorry if i sound kinda punchy that morning on the video... people just don't sleep at PyCon as a tradition. however, i think the slides are interesting and perhaps revealing if you find such a topic fascinating!

wescpy
A: 
Steven