I use the following approach to display a PDF within a JSP:
<object id="pdfObj" data='myController.do?#toolbar=0&navpanes=0&scrollbar=1&' type='application/pdf' width='100%' height='460px' onkeypress="javascript:alert('key press event not triggered!');"></object>
The toolbar and the navigation panes are hidden when the screen loads. The floating toolbar also is not visible. However, an F8 or a F4 opens up the toolbar or the navigation pane respectively.
An attempt on trapping the keypress or keydown event works for the rest of the screen but once I click within the PDF, the key press events are not captured and this results in the toolbar getting enabled.
I understand that stopping the PDF displayed in the browser from getting saved is not possible, atleast without tha use of any plugin.
However, my question here is more for preventing the function key press just to add one more layer that the user needs to go through to save the document.
[Update] Accommodating @robertc's comment below, can we have a script to capture the function keys at the screen level before that gets handled by the application that handles the embedded object?