Skip to main content
Participant
August 19, 2023
Question

where and how to display a warning message (app.alert) when press ctrl+p or use file>print?

  • August 19, 2023
  • 1 reply
  • 486 views

Hi,

I want to display a warning message in pdf form when user press ctrl+p or use file>print. I use this code 

if(event.ctrlKey && event.keyCode == 80) {
app.alert("You pressed Ctrl+P");
}

in document javascript and in a text field but it does not work. I have created a print button in pdf which display the message (if and only if you use button for printing). I want the same message to appear when use different printing option.

 

Thanks

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
August 19, 2023

Not possible. What you can do, though, is attach a script to the file's Will Print event, but it will only execute once the file is actually printed, not when the Print dialog is showing.