473,396 Members | 1,942 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Is this possible - Print PDF in popup window's IFRAME?

All

I am trying to achieve the following:

Main window page's asp code writes the following line to launch a popup
window (note the IFRAME has to be in the popup window, it 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 %>'; //probably superfluous
here.
frame1.focus();
frame1.onload = new function(){
setTimeout("window.print();",5000);
}
}
</script>
</head>

<body onload="javascript:printme();">
<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 window using javascript and cannot access
it with
tempprintwindow.frame1.focus(); or
tempprintwindow.frames["frame1"].focus(); or any similar attempts using
window and document objects - I have trawled the web and this should
work according to the solutions I have found.

Any help would be much appreciated.

Many thanks

--

Rich (change nospam to mlu035 to reply direct)

Jul 29 '05 #1
1 8775
VK
> 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.


PDF file is not a part of the page. It has its own menubar on the top
(if you look) and print button in that menu bar has to be clicked.
Otherwise you're printing the containing documeny which is indeed
empty. I don't know if Adobe plugin provides scriptable interface. You
may look at their site but my first guess would be no.

Jul 31 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Mel | last post by:
is it possible to have a popup window that is either invisible or 1x1 in total size ? i tried 10x10 and it shows up around 100x20 pixels !!! please help Mel
1
by: Gilles T. | last post by:
Hi! I have a popup window open with the showModalDialog function: window.showModalDialog('dialog.aspx',window,"status:no; resizable:yes; dialogWidth:900px; dialogHeight: 700px;"); and in...
4
by: moose | last post by:
OK Popup window? No problem PDF in popup? No problem But what about a couple of Close Window buttons? Imagine a "Close Window" button at the top of the popup page. Then the PDF which can...
3
by: delraydog | last post by:
I'm having a problem trying to use a single DIV object for a popup menu when I'm using embedded IFrames. All the IFrames have the same parent document but I can't make the popup appear inside of...
22
by: stephen | last post by:
I have created an order form that users javascript to create a new html document when the customers clicks the "print page" button. Once the new document has been created it then prints the...
7
by: ukrbend | last post by:
I use an iframe on my home page and everything works perfectly. But now I decided to add a popups to my page. The popups come not from within the iframe but from the parent frame. Again, everything...
2
by: Kosarko | last post by:
Hello, I know this should be kind of easy, but I am very unfamiliar with Javascript. What I am looking to do is have an image (coupon) that when clicked on, it either prompts for printing...
1
by: XP | last post by:
Hello Everyone, I was stuck with this really frustrating problem for sometime. Let me explain what I am trying to achieve: There is a form and an inner iframe. The form's target is set to the...
2
by: colinzhu | last post by:
I want to have the print dialog shown automatically after the the page is loaded, but when I try to call window.print() BEFORE the iframe, the print dialog is not shown at all. Anyone can help? ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.