Google Answers Logo
View Question
 
Q: PDF - Closing a browser window from a pdf file. ( No Answer,   1 Comment )
Question  
Subject: PDF - Closing a browser window from a pdf file.
Category: Computers > Programming
Asked by: hlf-ga
List Price: $25.00
Posted: 03 Oct 2005 15:22 PDT
Expires: 05 Oct 2005 09:45 PDT
Question ID: 575964
The scenario:

A PDF file is opened in a separate browser window.

The problem: How to create a link (image or text) in the PDF file
using either javascript or html to close the window to return to the
parent page.

In the PDF file, I tried using the javascript link action with 
javascript:window.close();

and

go to web page action http://www.website.dom target="_top"

Neither works.

I am certain this must have been done lots of times but I have been
unable to find a solution.
Answer  
There is no answer at this time.

Comments  
Subject: Re: PDF - Closing a browser window from a pdf file.
From: matthendrix-ga on 04 Oct 2005 23:43 PDT
 
Try opening the PDF files in a  new "framed" window, in the top frame
put your javascript commands in a button.  In the bottom frame have
your PDF load.

Create an link to your framed page like this:

<a href="pdf_in_frames.html?file=myfile.pdf">Click Here</a>

Now in the recieving frames page (in the bottom frame) put some
javascript that gets the query string and loads the PDF.  See below.

<script>
window.location.href=window.location.search.substring(window.location.search.indexOf('=')+1);
</script>

Try it, it works.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy