Skip to main content
Participant
July 12, 2018
Question

Looking for a way to capture page change via JavaScript

  • July 12, 2018
  • 4 replies
  • 415 views

Hi.

I have a multiple page document and there are buttons on the first page to direct me into different pages of the PDF. As there are buttons on the page to navigate around the PDF, I would like to disable the page change by keyboard or mouse scroll.

Is it possible to capture the page change event? or is there anyway to stop user from turning from page 1 to page 2 by mouse scroll or by page down/up keys on the keyboard for a multiple page document?

Does Adobe SDK provide a solution on this issue?

Thanks.

This topic has been closed for replies.

4 replies

try67
Community Expert
Community Expert
July 13, 2018

It is actually possible to do something like that using a script, but it's quite complicated and I don't think it's a good solution to limit the user like that.

Inspiring
July 12, 2018

Another option is to create a single page PDF that includes a single read-only button that's as large as the page. This button is used to display the page contents as the button's icon. The contents for each page can be stored in the PDF in hidden buttons or document-level icons. You'd have to use JavaScript to populate the button icon from these sources.

A potential downside is this is unlikely to work with any PDF viewer other than the desktop versions of Reader and Acrobat. This technique also has potential limitations and benefits with regard to printing.

Legend
July 12, 2018

A plug-in (C++) could, if not intercept the mouse and keyboard, notice a page change and navigate itself. It is awkward though and likely to have all sorts of unforeseen messy consequences. You probably need to think in terms of a dedicated app or viewer, not a general user tool for this.

Bernd Alheit
Community Expert
Community Expert
July 12, 2018

You can't stop the user using mouse or keyboard.

Workarounds:

Use for every page  a separate file.

Or use template pages. You can spawn and delete this pages.