I have a simple, table based HTML page with a very simple style sheet. I can open the page in IE7 and FireFox 3 and it looks exactly the same. I can print the page from both browsers and it looks exactly the same. We'll call the page "ProblemPage.htm"
Now, inside an ASP.Net page, I create an IFrame and load that HTML into the IFrame like this:
window.frames[iframeId].location.href = "../ProblemPage.htm";
When the user clicks a button on the ASP.Net page, it calls a function that does this:
window.frames[iframeId].focus();
window.frames[iframeId].print();
When I do that and print it, the Firefox version looks exactly the same as it did when I loaded the page separately and printed it. The IE7 version reduces all of the font sizes to about half.
Note that the page setup settings are pretty much set at their default. I've used different printers and printed directly to PDF. I've cleared my cache repeatedly to make sure I'm using the same CSS. Yet on the same IE7 session, the page by itself prints one way, the page printed via an IFrame as above prints with smaller fonts. While on a single Firefox session, the page by itself prints exactly the same as the page printed via the IFrame.
Any ideas? It appears that may some of my styles are "leaking" into the page when I'm printing it on IE or that IE is interpreting the styling different within the IFrame.
UPDATE
Well, I guess it isn't "leaking styles". If I put the Yahoo CSS Reset in the ProblemPage.css file, it is definitely picked up by both browsers in all four cases, but the problem remains: When IE prints the page from the IFrame, the font sizes are screwed up.
UPDATE 2
Never found the problem. Simpler test project didn't show the same problem and I suspect there may be a problem with master pages, themes, or something like that. Interestingly, the problem did not occur on IE6, just IE7.
I wound up hacking my way around the problem with conditionally commented CSS for IE7 only. That was the only part of the whole app where I had to used conditional CSS.
Still would like to have an answer (or even a few WAGs as to what to look for next).