printing HTML or PDF from Python

Martin Franklin mfranklin1 at gatwick.westerngeco.slb.com
Wed Oct 27 11:36:09 CEST 2004


On Tue, 26 Oct 2004 10:33:41 -0500, Donnal Walter <donnal at donnal.net>  
wrote:

> We want to be able to print HTML or PDF files to a given printer from  
> Python in a kind of batch mode (without opening a preview window or  
> printer dialog for each file). The printer is on a network, but for  
> testing purposes I have connected it to my desktop via LPT1. I can  
> easily print a text file from Python using:
>
> os.system("copy some.txt LPT1")
>

[snip]

Donnal,

I would first convert my HTML into PDF (thus solving one problem)
a quick google turned up a few 'free' (as in I didn't check how free)
html2pdf tools.

Now we only have one problem, PDF.  Printing PDF can be done I believe
using Ghostscript tools (GSView/gsprint on windows, gv / gs on *nix)

http://www.cs.wisc.edu/~ghost/

Cheers,
Martin.





More information about the Python-list mailing list