Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

PRB: Control Shape Is Distorted When You Print an ActiveX Control if You Use a Percent Value for the Height


Symptoms

When you print ActiveX controls in Internet Explorer or view the output in Print Preview, the output may appear elongated if the height is set as a percentage value. For example, a control that draws a circle may look like an ellipse when printed.

↑ Back to the top


Cause

This behavior can occur because the aspect ratio is different for the screen and the page. Typically, there is a wide, short-screen viewport for the Internet Explorer window, and a tall, narrow viewport for the printed page. When you print, or view output in Print Preview, you invoke a percent value of the viewport of the page, not the screen. You would notice similar behavior if you were viewing a very tall Internet Explorer window (with no proportionate expansion of the width).

If you do not size the control to the viewport of the printed page, you have to continually resize your browser window until the document fits within your page or margin area.

↑ Back to the top


Resolution

To preserve the layout of your page when you print it, use a specific non-relative value instead of a percentage. If you want your control to occupy a certain percentage of the screen, you can calculate the appropriate height dynamically through code. For example, instead of setting the height in the OBJECT tag in the following manner
<OBJECT id="myControl" classid="clsid:8E27C92B-1264-101C-8A2F-040224009C02" height="75%">
				
set the height from the onLoad event of the BODY tag, as follows:
<BODY onload="javascript:myControl.height=document.body.offsetHeight * 0.75;">
<OBJECT id="myControl" classid="clsid:8E27C92B-1264-101C-8A2F-040224009C02" >
				

↑ Back to the top


Status

This behavior is by design.

↑ Back to the top


More information

Steps to Reproduce the Problem

Use the following code to set the dimensions for the Calendar control:
<HTML><BODY>
<OBJECT id="Calendar1" classid="clsid:8E27C92B-1264-101C-8A2F-040224009C02" width="600" height="100%">

</OBJECT>
</BODY><BR/>
</HTML>
				
Then, print the page. Note the behavior described in the "Symptoms" section of this article.

↑ Back to the top


References

For more information about how to develop Web-based solutions for Internet Explorer, browse to the following MSDN Web sites:

↑ Back to the top


Properties

Retired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.

↑ Back to the top


Keywords: KB311757, kbprb, kbbug

↑ Back to the top

Article Info
Article ID : 311757
Revision : 3
Created on : 10/26/2012
Published on : 10/26/2012
Exists online : False
Views : 164