G
Guest
All
I am trying to achieve the following:
asp code writes the following line to launch a popup window (note the
iframe has to be in the new window, cannot be in the current page)
response.write("<script language='JavaScript'>var tempprintwindow =
window.open('papertempprint.asp?path=" & filePath & "','');")
And the code in papertempprint.asp is as follows:
<%
Dim location
location = Request.QueryString("path")
%>
<html>
<head>
<script language="JavaScript">
function printme() {
frame1.location.href = '<%= location %>';
frame1.focus();
frame1.onload = new function(){
setTimeout("window.print();",5000);
}
}
</script>
</head>
<body onload="javascriptrintme();">
<IFRAME height="600" width="800" name="frame1" src="<%= location %>"
visible="false"></IFRAME>
</body>
</html>
Popup redirects its Iframe to the pdf file then prints via window.print
I get the windows print prompt fine, but when I print, just one blank
page comes out of the printer.
Is what I am trying to achieve possible. I have tried accessing the
popup Iframe from the parent using javascript and cannot access it with
tempprintwindow.frame1.focus(); or
tempprintwindow.frames["frame1"].focus(); or any similar attempts using
window and document objects
Any help would be much appreciated.
Many thanks
I am trying to achieve the following:
asp code writes the following line to launch a popup window (note the
iframe has to be in the new window, cannot be in the current page)
response.write("<script language='JavaScript'>var tempprintwindow =
window.open('papertempprint.asp?path=" & filePath & "','');")
And the code in papertempprint.asp is as follows:
<%
Dim location
location = Request.QueryString("path")
%>
<html>
<head>
<script language="JavaScript">
function printme() {
frame1.location.href = '<%= location %>';
frame1.focus();
frame1.onload = new function(){
setTimeout("window.print();",5000);
}
}
</script>
</head>
<body onload="javascriptrintme();">
<IFRAME height="600" width="800" name="frame1" src="<%= location %>"
visible="false"></IFRAME>
</body>
</html>
Popup redirects its Iframe to the pdf file then prints via window.print
I get the windows print prompt fine, but when I print, just one blank
page comes out of the printer.
Is what I am trying to achieve possible. I have tried accessing the
popup Iframe from the parent using javascript and cannot access it with
tempprintwindow.frame1.focus(); or
tempprintwindow.frames["frame1"].focus(); or any similar attempts using
window and document objects
Any help would be much appreciated.
Many thanks