Click to See Complete Forum and Search --> : Print Scaling in IE7


chestertb
03-06-2008, 04:06 PM
Does anyone know how to switch off the default "Scale to Fit" feature in IE7?

We have a browser based point of sale system that generates a receipt in an iframe and then uses javascript print() to send it to the printer. It works perfectly in IE6 and Firefox, but IE7 insists on scaling the print, which means the receipt prints out at 63%. Sadly, I don't have a stock of magnifying glasses to hand customers with their teeny weeny little receipts.

bathurst_guy
03-06-2008, 04:26 PM
This article (http://support.microsoft.com/kb/932538/) may help, as the registry editing affects IE.

chestertb
03-06-2008, 07:14 PM
thanks.
unfortunately, the registry key the article refers to isn't in my registry.

bathurst_guy
03-07-2008, 02:46 AM
Create it then and see if it works. Restart might be required.

chestertb
07-27-2008, 08:06 PM
I found a javascript solution to this... elegant, simple, and it doesn't require the user tinkering with registry values just to accommodate your web page.

To print from IE7 without automatic scaling, instead of
print()
use

<script language="javascript">
function printit()
{
if(navigator.appVersion.indexOf("MSIE 7") != -1)
{
//detects IE7 and uses this to print
document.execCommand('print',false,null);
}
else
{
//uses this to print from any other browser
print();
}
}
</script>

Credit to "i_m_fury" who posted the "document.execCommand" solution on a Microsoft forum.