Printing rendered HTML in .net

  • Thread starter Thread starter Hasani
  • Start date Start date
H

Hasani

right now, for printing HTML in .net
I use a AxBrowser and I do
ExecWB(SHDocVw.OLECMDID.OLECMDID_PRINT,
SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER)

I then call Application.DoEvents() in a loop for 1 min and hope all of it
was spooled. Unfortunately, I'd say for every 600 times I use this method, 1
print job goes bad, it was either not printed or in 1 case, part of the
rendered HTML was printed. The HTML data, when spooled, is always about
100~150kbytes, and when I tested it, it would usually spool in less than 15
seconds, so 1min should me more than enough.

Unfortunately, my boss said he wants everything to print, so I ask, are
there any components in .net that will render and print the rendered HTML?
Does anyone know of any alternatives.

ExecWB() returns immediately but it doesn't notify me when the data has been
spooled. Is there anyway I can be notified when the data has been spooled?

Thx in advance.
 
Ok, I think I found a workable solution, listen for the
AxWebBrowser.PrintTemplateTeardown event!
 
Back
Top