[python-win32] win32print.StartDocPrinter

Tim Roberts timr at probo.com
Wed Jul 6 21:54:10 CEST 2011


Anthony Sterrett wrote:
> What are the available data types accepted by /tuple/ in
> win32print.StartDocPrinter(/hprinter, level, tuple/)? Or, if this is
> determined by my printer driver, how can I find this information?

RAW and EMFSPOOL are predefined.  The printer driver might define other
types, but few do so.

> I am trying to hack together a program that will print a html file
> I've generated onto a 3x5 index card... code below:
> ...
> So what I'm really asking, if anyone can answer, is this: How do I
> turn my HTML file into something I can print?

You have to render the HTML, just like a browser would.  That, of
course, is not a trivial task, especially if you have tables and
stylesheets.  You could use Internet Explorer to do this, or embed one
of the other browsers.

Perhaps you should look at the wx.html.HtmlEasyPrinting module in
wxPython.  It doesn't take arbitrary HTML, but it works for generating
reports and things.

-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the python-win32 mailing list