I have an HTML (parent) webpage containing a hyperlink. When clicked, a new window opens and another HTML document (child) is displayed:
<a href="/testhtml.html" target="_blank">Open Child</a>
Inside the child document are several links, which are structured as follows:
<a href="#" onclick='opener.window.location.href="/somewhere.html"; window.close();'>Make Parent Go Somewhere</a>
Thus, the effect is that you can click the link in the child window, this will cause the parent window to go to the new uri and then close. It works great.
I would like to do the same with PDF as a child document. I can embed hyperlinks in PDF just fine or even embed Javascript:
13 0 obj << /Type /Action /S /JavaScript /JS (opener.window.location.href="/somewhere.html";) >> endobj
Javascript runs beautifully, but the opener object is undefined. ( ReferenceError: opener is not defined 1: Link:Mouse Up ) Is what I want to do is even possible? What would be the object that I would use to access the uri opening window?
PS: If this is a problem, I have some control over the target user environment. I can indicate that they use Acrobat Reader and even a later version.
source share