473,569 Members | 2,593 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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='JavaS cript'>var tempprintwindow =
window.open('pa pertempprint.as p?path=" & filePath & "','');")

And the code in papertempprint. asp is as follows:

<%
Dim location
location = Request.QuerySt ring("path")
%>
<html>
<head>
<script language="JavaS cript">
function printme() {
frame1.location .href = '<%= location %>'; //probably superfluous
here.
frame1.focus();
frame1.onload = new function(){
setTimeout("win dow.print();",5 000);
}
}
</script>
</head>

<body onload="javascr ipt: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 8811
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
1635
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
4146
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 dialog.aspx, I need to print the page with javascript function window.print but this function don't work with the showModalDialog window. Why?
4
20777
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 scroll. And another "Close Window" button at the bottom of the page. Any suggestions for completing this task?
3
1925
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 each IFrame unless I appendChild the popup DIV to each individual IFrame document body. Should I be able to show the popup without having to reparent...
22
130050
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 document and closes it with the following code: <body onload="window.print(); window.close();"> This works correctly (or at least the way I expect...
7
4711
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 regarding the popup works perfectly, it pops up with the correct data. But the strange thing is now any link that targets the iframe simply get...
2
6836
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 only that image, or pops up a window and automatically after loading the image in the new window, brings up the print dialog box. What would you...
1
5266
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 iframe so that when the form is submitted, the page does not get reloaded/changed ( as the iframe would be the one getting refreshed. The Iframe is...
2
5096
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? Here is my code: <html> <head> <title>Auto print the page</title> </head>
0
7700
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7924
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7676
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5513
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2114
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1221
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
938
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.