Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • EspaƱol
      • FranƧais
      • PortuguĆŖs
  • ę—„ęœ¬čŖžć‚³ćƒŸćƒ„ćƒ‹ćƒ†ć‚£
  • ķ•œźµ­ ģ»¤ė®¤ė‹ˆķ‹°
4

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

New Here ,
Aug 19, 2023 Aug 19, 2023

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

TOPICS
JavaScript , PDF forms
376
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 19, 2023 Aug 19, 2023
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines