Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Print HTML from Python

Reply
Thread Tools

Print HTML from Python

 
 
Jorgen Bodde
Guest
Posts: n/a
 
      05-21-2008
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
 
Reply With Quote
 
 
 
 
Mike Driscoll
Guest
Posts: n/a
 
      05-21-2008
On May 21, 3:45*am, "Jorgen Bodde" <(E-Mail Removed)> wrote:
> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there any difference between print 3 and print '3' in Python ? redstone-cold@163.com Python 15 09-10-2012 07:16 AM
print a vs print '%s' % a vs print '%f' a David Cournapeau Python 0 12-30-2008 03:19 AM
Problem - I want to print Current Output of Pdf file and should print once.I get print dialog box but it is not working keto Java 0 05-30-2007 11:27 AM
Print HTML Report Page or Print multiple application pages Sam ASP .Net 1 11-10-2006 10:05 PM
Unlarging the print to print using PDF file to print Bun Mui Computer Support 3 09-13-2004 03:15 AM



Advertisments