467,145 Members | 960 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,145 developers. It's quick & easy.

Print HTML from Python

Hi All,

I am at a loss. This is slightly OT because it concerns Windows and
HTML printing. I would like to print a HTML document from Python, but
not showing the printing dialog. After numerous searches and trials I
came to the conclusion that ShellExecute with the "print" command and
a HTML document simply always shows a print dialog, so that road is a
dead end (or unless someone can show me a snippet that does work).

I used win32com and I am able to print through he internet explorer
interface which seems to work, but quite unreliably. When I execute
the scipt too fast, nothing is printed at all. The method isBusy that
IE exposes through COM always returns False so there is no way to wait
reliably on the progress of the printer.

So basically my question is, does someone know a python lib or way to
print HTML to the default printer (I can get the printer name so even
that is not really needed) without showing the print dialog?

With regards,
- Jorgen
Jun 27 '08 #1
  • viewed: 1743
Share:
1 Reply
On May 21, 3:45*am, "Jorgen Bodde" <jorgen.maill...@gmail.comwrote:
Hi All,

I am at a loss. This is slightly OT because it concerns Windows and
HTML printing. I would like to print a HTML document from Python, but
not showing the printing dialog. After numerous searches and trials I
came to the conclusion that ShellExecute with the "print" command and
a HTML document simply always shows a print dialog, so that road is a
dead end (or unless someone can show me a snippet that does work).

I used win32com and I am able to print through he internet explorer
interface which seems to work, but quite unreliably. When I execute
the scipt too fast, nothing is printed at all. The method isBusy that
IE exposes through COM always returns False so there is no way to wait
reliably on the progress of the printer.

So basically my question is, does someone know a python lib or way to
print HTML to the default printer (I can get the printer name so even
that is not really needed) without showing the print dialog?

With regards,
- Jorgen

Did you try all the methods on Tim Golden's site?

http://timgolden.me.uk/python/win32_how_do_i/print.html

I use the one at the bottom for PDFs. I never see a print dialog, but
it does leave Adobe running. If you're printing from Internet
Explorer, you might look at the PAMIE project.

http://pamie.sourceforge.net/

HTH

Mike
Jun 27 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Andrew Chalk | last post: by
6 posts views Thread by Ruchika | last post: by
14 posts views Thread by Marcin Ciura | last post: by
2 posts views Thread by jamesthiele.usenet@gmail.com | last post: by
reply views Thread by bearophileHUGS@lycos.com | last post: by
69 posts views Thread by Edward K Ream | last post: by
3 posts views Thread by Hutch | last post: by
4 posts views Thread by barronmo | last post: by
1 post views Thread by RC | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.