HTML printing from browser control
Posted on 2003-02-24
My (Visual Basic 6) application uses IE's webbrowser control (embedded) to render/view HTML reports. I am not happy with the printing support from the control. I have the following specific problems:
1) THEAD/TFOOT tags does not repeat on the next page when a table is split accross printed pages (as the HTML specification says it should)
2) Lines are sometimes lost at page breaks - this depends on the margin settings & printer driver
3) Very tricky to set page orientation/margins etc. from VB code before using the ExecWB...PRINT method of the browser to do the actual printing (especially if you have to cater for different IE versions).
I am looking for something that will help with all three of the problems above . . .
These are some of the things I am considering:
a) Convert the HTML to some other format (PDF/Rich Text/Postscript) using some conversion tool (?) and then printing the "result"
--> which format?, which converter?
--> does these formats (and the tools that goes with them) fix my problems
ie. does the PDF specification allow for tables with column headers, and the automatic re-print of headers on the "next" page
how tricky is it to print these formats (from VB code), can one get at the page-setup properties from code (will probably depend on what tool does the actual printing)
--> I get the feeling that this option will introduce more _new_ problems than it will solve
b) IE Print templates
--> this one promises a lot but the samples & documentation (MSDN) is somewhat vague - seriously steep learning-curve to try and understand the technology (and all that just to determine if it may be the answer to my problem)
--> any experts on this subject that can say yea or nea?
c) code my own parser & print logic (we use a very small subset of HTML, mainly <TABLE> stuff)
Any other options that anyone can think of ?
I am cross-posting this one to the HTML and Browser Issues groups
I doubt anyone will give a complete answer, will distribute points between most helfull comments.