I have an HTML web page (the parent) that contains a hyperlink. When clicked, it opens a new window and displays another HTML document (the child):
<a href="/testhtml.html" target="_blank">Open Child</a>
Inside the child document are several links that are constructed like this:
<a href="#" onclick='opener.window.location.href="/somewhere.html";
window.close();'>Make Parent Go Somewhere</a>
So the effect is that you can click on a link in the child window, it will cause the parent window to go to that new uri, and then close itself. This works wonderfully.
I'd like to do that same thing with a PDF as the child document. I can embed hyperlinks in the PDF just fine, or even embed Javascript:
13 0 obj
<<
/Type /Action
/S /JavaScript /JS
(opener.window.location.href="/somewhere.html";)
>>
endobj
The Javascript gets triggered nicely, but the object "opener" is not defined. (ReferenceError: opener is not defined 1: Link:Mouse Up
) Is what I'm looking to do even possible? What would be the object I would use to access the opening window's uri?
PS: If it's a problem, I do have some control over the user's target environment. I can specify that they use Acrobat Reader, and even a later version of it.