473,385 Members | 1,331 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,385 software developers and data experts.

PDF popup with close button

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?
Jul 23 '05 #1
4 20747
"moose" <sk********@excite.com> wrote in message
news:57*************************@posting.google.co m...
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?


Will this help you; watch for word-wrap.

<html>
<head>
<title>popupPDF.htm</title>
<script type="text/javascript">
function popupPDF() {
var pdf = "http://www.google.com/";
var htm = "<html><head><title>popupPDF</title>";
htm += "</head><body>";
htm += "<a href='javascript:window.close()'>Close</a>";
htm += "<iframe src='" + pdf +"'></iframe>";
htm += "<a href='javascript:window.close()'>Close</a>";
htm += "</body></html>";
var win = window.open("","popupPDF","");
win.document.write(htm);
win.close;
}
</script>
</head>
<body>
<a href="javascript:popupPDF()">Popup PDF</a>
</body>
</html>
Jul 23 '05 #2
> 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?

One can also use the cross on the top right side of the window ;-)
You can also float a close button (or image) above the PDF in one corner
AFAIK

Richard

Jul 23 '05 #3
"McKirahan" <Ne**@McKirahan.com> wrote in message
news:5VX5d.33815$He1.945@attbi_s01...
"moose" <sk********@excite.com> wrote in message
news:57*************************@posting.google.co m...
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?


You've asked for a "Close" button not a link:

<html>
<head>
<title>popupPDF.htm</title>
<script type="text/javascript">
function popupPDF() {
var pdf = "http://www.google.com/";
var htm = "<html><head><title>popupPDF</title>";
htm += "</head><body><center>";
htm += "<input type='button' value='Close'
onclick='window.close()'>";
htm += "<br><br>";
htm += "<iframe src='" + pdf +"'></iframe>";
htm += "<br><br>";
htm += "<input type='button' value='Close'
onclick='window.close()'>";
htm += "</center></body></html>";
var win = window.open("","popupPDF","");
win.document.write(htm);
win.close;
}
</script>
</head>
<body>
<a href="javascript:popupPDF()">Popup PDF</a>
</body>
</html>
Jul 23 '05 #4
moose wrote:
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?
<a href="loadpdf.cgi?pdf=somefile.pdf"
target="_blank"
onclick="window.open(this.href, this.target,
'..attributes..');return false;"Open somefile.pdf in a new window (maybe, if you haven't

disabled that functionality on your browser)</a>

Then have loadpdf.cgi output (using an ASP example, you could use
PHP, or Perl, or JSP, or ColdFusion, or any other server-side
technology for this):

<html>
<head>
<title>Window containing <%= Request.Value('pdf') %></title>
</head>
<body>
<!-- your close buttons and stuff -->
<layer src="<%= Request.Value('pdf') %>"><iframe src="<%=
Request.Value('pdf') %>"></iframe></layer>
<!-- more buttons or whatever -->
</body>
</html>

You probably want some dimensions on the <layer> or <iframe> to make
it bigger than the default size. But remember, the window may not be
the size _you_ specify. Many browsers can honor your window.open()
request but still not provide a window the size, position and with
the chrome you requested.

--
Grant Wagner <gw*****@agricoreunited.com>
comp.lang.javascript FAQ - http://jibbering.com/faq

Jul 23 '05 #5

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

Similar topics

1
by: dibyendu_k | last post by:
Hi, There is a problem i cant solve regarding Internet Explorer 5.5. It is regarding the Print Dialog Box. From a webpage if I open a popup window (window.open()) containing buttons Print and...
4
by: GrantS | last post by:
I am having a problem closing a popup window opened modally. When I try to close the window (when the user hits save button and the data has been processed), the Popup window opens as a full screen...
4
by: SteveS | last post by:
Hello. This is a strange problem which does not make sense to me. I open a popup page with the following javascript code: function OpenDenyWindow(changeId) {...
1
by: Earl Teigrob | last post by:
I did a ton of searching to try and find a simple solution to this issue and finally wrote my own, which I am sharing with everyone. In my searching, I did find a very complete and robust solution at...
18
by: Colin McGuire | last post by:
Hi - this was posted last weekend and unfortunately not resolved. The solutions that were posted almost worked but after another 5 days of working on the code everynight, I am not further ahead....
2
by: jackson2005 | last post by:
OK, I need to do three different things. On the ONLOAD event I would like a popup box to open. In this popup box I need two text boxes. One for the UserName and one for the BillingTo name. ...
2
by: wreed06 | last post by:
Hello, I have 2 problems. In my webpage, I have a dropdown list with a button that takes the user to a popup window specific to the option. I am using Firefox 2.0.0.13. I have successfully...
5
by: wreed06 | last post by:
I have 2 problems. In my webpage, I have a dropdown list with a button that takes the user to a popup window specific to the option. I am using Firefox 2.0.0.13. I have successfully validated my HTML...
1
by: dittu | last post by:
How to close the popup window when submitting the form? I have a sample.jsp. In that page one button is there. when button pressed, open popup window contains one "text box" and one " submit...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.