Printing from wx.lib.iewin.IEHtmlWindow

I don't know if this is the best way to do this or not, but I had to print
an HTML page from the command line in another file. On Windows, one way
to do this is as below:

rundll32.exe mshtml.dll,PrintHTML "c:\temp\allclasses-frame.html"

This brings up Internet Exploder's print panel directly for that file. I
don't if this command is accessible from IEHtmlWindow.

HTH,
Hubert Hickman
hubert@tconl.com

T.Peter Herndon wrote:

Hello,

I built an application that uses a Cheetah template as a template for a

report. The app allows the end-user to choose the parameters of the
report, then fills in the template, generating an HTML document. Under
wxPython 2.4, I was using a wx.html.HtmlWindow to display the page, and
was using standard buttons and events to allow the end user to print the
page.

Moving to 2.5, the rendering engine in wx.html.HtmlWindow has changed,

and my page no longer renders the same. In short, yuck. I am trying to
use wx.lib.iewin.IEHtmlWindow in its place, as IE renders my page
reasonably well. However, I can not figure out how to tell the
IEHtmlWindow to print. I know I can right-click on the window and
choose Print... from the context menu, but I'd like to be able to do
this with a clearly-labeled button. Is there a way to send a print
command to the window? Would that be the normal wx.Printer, wx.Printout
way? I was using wx.html.HtmlEasyPrinting on the old version.

Alternately, is there a way to show the IE menu and/or toolbars? I

noticed a ShowBrowserBar method, but it takes parameters that I don't
know anything about.

···

Thanks in advance for your help,

---Peter Herndon

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

Thanks for the idea, Hubert, but that does not help. I'm not actually generating an HTML file, I'm generating the page in memory as a string and handing that off to the IEHtmlWindow for rendering. Since the report may contain sensitive information, I don't want to write files to the filesystem if I can avoid it.

Thanks for the thought, though, I'll have to remember that for future use.

---Peter

···

On Sep 15, 2004, at 1:42 PM, Hubert Hickman wrote:

rundll32.exe mshtml.dll,PrintHTML "c:\temp\allclasses-frame.html"

This brings up Internet Exploder's print panel directly for that file. I
don't if this command is accessible from IEHtmlWindow.

Just speculating (I'm preparing to face the same problem later today):

1. have a local html file ('printit.html')
2. that html file has an iframe with its target defined as %(url)s and
some javascript to automatically print the contents of that iframe
3. read printit.html, substituting in the url for the real page and pass
it to IE.

I don't know if that would work or not.

Regards,
Cliff

···

On Wed, 2004-09-15 at 14:17 -0400, T.Peter Herndon wrote:

On Sep 15, 2004, at 1:42 PM, Hubert Hickman wrote:

> rundll32.exe mshtml.dll,PrintHTML "c:\temp\allclasses-frame.html"
>
> This brings up Internet Exploder's print panel directly for that file.
> I
> don't if this command is accessible from IEHtmlWindow.
>

Thanks for the idea, Hubert, but that does not help. I'm not actually
generating an HTML file, I'm generating the page in memory as a string
and handing that off to the IEHtmlWindow for rendering. Since the
report may contain sensitive information, I don't want to write files
to the filesystem if I can avoid it.

Thanks for the thought, though, I'll have to remember that for future
use.

--
Cliff Wells <clifford.wells@comcast.net>

Pass it the URL rather than the filename.

rundll32.exe mshtml.dll,PrintHTML "http://www.google.com"

Works like a charm.

···

On Wed, 2004-09-15 at 14:17 -0400, T.Peter Herndon wrote:

On Sep 15, 2004, at 1:42 PM, Hubert Hickman wrote:

> rundll32.exe mshtml.dll,PrintHTML "c:\temp\allclasses-frame.html"
>
> This brings up Internet Exploder's print panel directly for that file.
> I
> don't if this command is accessible from IEHtmlWindow.
>

Thanks for the idea, Hubert, but that does not help. I'm not actually
generating an HTML file, I'm generating the page in memory as a string
and handing that off to the IEHtmlWindow for rendering. Since the
report may contain sensitive information, I don't want to write files
to the filesystem if I can avoid it.

--
Cliff Wells <clifford.wells@comcast.net>