Code to target specific pages in a PDF file (in the same window)
Hello Webdeveloper community.
I am searching for JavaScript Code that would help users open targeted pages (starting separate chapters) in the same PDF file within the same window external to the Website (so I only want one session of the PDF document).
The HTML code target="_blank" opens the same document in separate windows (separate sessions), and I need to avoid Windows clutter on the desktop or mobile device.
I tried using target="catalog" so that these specific pages open in the same window -- a code I found in the HTML Visual Quickstart Guide
I found a Javascript code also, but it does not open the new chapter in the same window.
This is what I have in the page's code:
<li><a href="javascript:newWindow('media/wtxcat.pdf#page=5')">Introduction (exhibit catalog)</a></li>
<li><a href="javascript:newWindow('media/wtxcat.pdf#page=7')">Chapter One (exhibit catalog)</a></li>
I want to use this or an alternate method to allow users going to different pages of the PDF document while keeping that PDF document open in the same window. Perhaps I am missing a line that would clear the previous page first.
Here is the js file, which I got out of the JavaScript Visual Quickstart Guide:
Bookmarks