jai
10-10-2003, 10:10 AM
I created a web page with three frames.
First frame(frame1) contains 2 buttons to print images in
other two frames. one button prints image in frame2 and
other prints image in frame3.
Prob: Frame2 is hidden. and when I try to print image in
this frame it prints a blank page. The requirement is that I
can not show the image to the user and the frame should be
hidden.
Frame3 is visible and contains an image and when I try to
print this frame, it prints fine.
I use Javascript to print the images.
I tested printing of hidden frame using Netscape 6.2, it
works fine.
This problem is related to Netscape 7.1.
If I make frame2 as visible then it prints but resizes the
image.
Please help.
This is very urgent and I have already spent few days on
this problem.
--------------Code ......Popup.htm--------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Popup</title>
<SCRIPT Language="JavaScript" runat="server">
function OpenWindow()
{
var retHTMLStr;
var sstr;
//retHTMLStr = "<html><head><title >Print Postage</title> <meta http-equiv='Content-Type' content='text/html' charset='iso-8859-1'> </head> <frameset rows='70,1,606' framespacing='0' frameborder='No' border='0'> <frame src='./Images/f9e286250-77ae-4517-abba-72f0c82297b2.gif' name='topFrame' scrolling='NO' noresize> <frame src='./Images/s9e286250-77ae-4517-abba-72f0c82297b2.gif' name='middleFrame' scrolling='NO' noresize> <frame src='main.htm' name='mainFrame' scrolling='NO' noresize> </frameset> <noframes> <body> </body> </noframes> </html>"
retHTMLStr = "<html> <head> <title>Print Postage</title> </head> <frameset rows='70,1,606' framespacing='0' border='0' frameborder='0'> <frame scrolling='no' noresize target='middle' src='main.htm' name='mainFrame' noresize marginwidth='0' marginheight='0'> <frame target='bottom' src='./Images/s9e286250-77ae-4517-abba-72f0c82297b2.gif' name='topFrame' marginwidth='0' marginheight='0' scrolling='no' noresize> <frame src='./Images/s9e286250-77ae-4517-abba-72f0c82297b2.gif' name='middleFrame' noresize marginwidth='0' marginheight='0' scrolling='auto'> <noframes> <body> <p>This page uses frames, but your browser does not support them.</p> </body> </noframes> </frameset> </html>";
var oWin = window.open("", "win", "resizable=no, fullscreen=0, toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=no, titlebar=no, width=510, height=650");
var oNewDoc = oWin.document;
oNewDoc.open("text/html", "replace");
var sMarkup = retHTMLStr;
oNewDoc.write(sMarkup);
oNewDoc.close();
}
</Script>
</head>
<body>
<INPUT type="button" value="Button" ID="Button2" NAME="Button1" onclick="OpenWindow()">
</body>
</html>
-----------------------------------------------------------
--------------------------code--main.htm-----------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body onload="showhide()">
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="8" width="50%">
<tr>
<td width="25%"></td>
<td width="25%"><input name="btnSubmit" type="button" value="Print Label" onClick="myprint();"></td>
<td width="25%"><input name="btnSample" type="button" value="Print Sample Label" onClick="myprintsample();"></td>
<td width="25%"></td>
</tr>
</table>
</center>
</div>
<SPAN id="Warningspan" STYLE="position:relative; visibility:visible;"><B><font color="#0000FF">Click the [Print Label] button to attempt printing again.</font></B></SPAN>
<input name="txtCount" type="hidden" id="txtCount" VALUE="1">
<input name="txtRequestId" type="hidden" id="txtRequestId" VALUE="@@tranID@@">
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function showhide()
{
var targetobj;
var is = new Is();
if (is.nav4up) targetObj = window.parent.mainFrame.document.getElementById('Warningspan');
else if (is.ie4up) targetObj = window.parent.mainFrame.document.getElementById('Warningspan');
//alert('ShowHide');
if (targetObj.style.visibility == "hidden")
{
targetObj.style.visibility = "visible";
}
else
{
targetObj.style.visibility = "hidden";
}
}
function Is ()
{ // convert all characters to lowercase to simplify testing
var agt=navigator.userAgent.toLowerCase()
this.nav = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
&& (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
&& (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
this.ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
this.major = parseInt(navigator.appVersion) ;
this.minor = parseFloat(navigator.appVersion) ;
this.nav4up = (this.nav && (this.major >= 4)) ;
this.ie4up = (this.ie && (this.major >= 4)) ;
this.opera = (agt.indexOf("opera") != -1) ;
}
function myprint()
{
var is = new Is();
if (is.nav4up)
{
top.topFrame.focus();
top.topFrame.print();
}
else if (is.ie4up)
{
window.parent.topFrame.focus();
window.print() ;
}
}
function myprintsample() {
var is = new Is();
if (is.nav4up)
{
top.middleFrame.focus();
top.middleFrame.print();
}
else if (is.ie4up)
{
window.parent.middleFrame.focus();
window.print() ;
}
}
// End -->
</script>
</body>
</html>
------------------------------------------------------------
any suggestion will be helpfull.
Thanks in advance,
Jai
First frame(frame1) contains 2 buttons to print images in
other two frames. one button prints image in frame2 and
other prints image in frame3.
Prob: Frame2 is hidden. and when I try to print image in
this frame it prints a blank page. The requirement is that I
can not show the image to the user and the frame should be
hidden.
Frame3 is visible and contains an image and when I try to
print this frame, it prints fine.
I use Javascript to print the images.
I tested printing of hidden frame using Netscape 6.2, it
works fine.
This problem is related to Netscape 7.1.
If I make frame2 as visible then it prints but resizes the
image.
Please help.
This is very urgent and I have already spent few days on
this problem.
--------------Code ......Popup.htm--------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Popup</title>
<SCRIPT Language="JavaScript" runat="server">
function OpenWindow()
{
var retHTMLStr;
var sstr;
//retHTMLStr = "<html><head><title >Print Postage</title> <meta http-equiv='Content-Type' content='text/html' charset='iso-8859-1'> </head> <frameset rows='70,1,606' framespacing='0' frameborder='No' border='0'> <frame src='./Images/f9e286250-77ae-4517-abba-72f0c82297b2.gif' name='topFrame' scrolling='NO' noresize> <frame src='./Images/s9e286250-77ae-4517-abba-72f0c82297b2.gif' name='middleFrame' scrolling='NO' noresize> <frame src='main.htm' name='mainFrame' scrolling='NO' noresize> </frameset> <noframes> <body> </body> </noframes> </html>"
retHTMLStr = "<html> <head> <title>Print Postage</title> </head> <frameset rows='70,1,606' framespacing='0' border='0' frameborder='0'> <frame scrolling='no' noresize target='middle' src='main.htm' name='mainFrame' noresize marginwidth='0' marginheight='0'> <frame target='bottom' src='./Images/s9e286250-77ae-4517-abba-72f0c82297b2.gif' name='topFrame' marginwidth='0' marginheight='0' scrolling='no' noresize> <frame src='./Images/s9e286250-77ae-4517-abba-72f0c82297b2.gif' name='middleFrame' noresize marginwidth='0' marginheight='0' scrolling='auto'> <noframes> <body> <p>This page uses frames, but your browser does not support them.</p> </body> </noframes> </frameset> </html>";
var oWin = window.open("", "win", "resizable=no, fullscreen=0, toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=no, titlebar=no, width=510, height=650");
var oNewDoc = oWin.document;
oNewDoc.open("text/html", "replace");
var sMarkup = retHTMLStr;
oNewDoc.write(sMarkup);
oNewDoc.close();
}
</Script>
</head>
<body>
<INPUT type="button" value="Button" ID="Button2" NAME="Button1" onclick="OpenWindow()">
</body>
</html>
-----------------------------------------------------------
--------------------------code--main.htm-----------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body onload="showhide()">
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="8" width="50%">
<tr>
<td width="25%"></td>
<td width="25%"><input name="btnSubmit" type="button" value="Print Label" onClick="myprint();"></td>
<td width="25%"><input name="btnSample" type="button" value="Print Sample Label" onClick="myprintsample();"></td>
<td width="25%"></td>
</tr>
</table>
</center>
</div>
<SPAN id="Warningspan" STYLE="position:relative; visibility:visible;"><B><font color="#0000FF">Click the [Print Label] button to attempt printing again.</font></B></SPAN>
<input name="txtCount" type="hidden" id="txtCount" VALUE="1">
<input name="txtRequestId" type="hidden" id="txtRequestId" VALUE="@@tranID@@">
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function showhide()
{
var targetobj;
var is = new Is();
if (is.nav4up) targetObj = window.parent.mainFrame.document.getElementById('Warningspan');
else if (is.ie4up) targetObj = window.parent.mainFrame.document.getElementById('Warningspan');
//alert('ShowHide');
if (targetObj.style.visibility == "hidden")
{
targetObj.style.visibility = "visible";
}
else
{
targetObj.style.visibility = "hidden";
}
}
function Is ()
{ // convert all characters to lowercase to simplify testing
var agt=navigator.userAgent.toLowerCase()
this.nav = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
&& (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
&& (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
this.ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
this.major = parseInt(navigator.appVersion) ;
this.minor = parseFloat(navigator.appVersion) ;
this.nav4up = (this.nav && (this.major >= 4)) ;
this.ie4up = (this.ie && (this.major >= 4)) ;
this.opera = (agt.indexOf("opera") != -1) ;
}
function myprint()
{
var is = new Is();
if (is.nav4up)
{
top.topFrame.focus();
top.topFrame.print();
}
else if (is.ie4up)
{
window.parent.topFrame.focus();
window.print() ;
}
}
function myprintsample() {
var is = new Is();
if (is.nav4up)
{
top.middleFrame.focus();
top.middleFrame.print();
}
else if (is.ie4up)
{
window.parent.middleFrame.focus();
window.print() ;
}
}
// End -->
</script>
</body>
</html>
------------------------------------------------------------
any suggestion will be helpfull.
Thanks in advance,
Jai