MessageBox after event prePrint – cancelEvent | Community
Skip to main content
Level 2
June 23, 2021
Solved

MessageBox after event prePrint – cancelEvent

  • June 23, 2021
  • 1 reply
  • 1014 views

Hi,

 

in a dynamic form i am catching all user fired print events in the Form::prePrint event with xfa.event.cancelAction = 1, change the print settings to my defaults and start a print job. Until here it works fine.

 

But: Triggered by xfa.event.cancelAction = 1 Acrobat opens a messagebox "Print canceled" before it starts my print job. I can dismiss the messagebox and the code runs like planned, but this messagebox is very anoying.

 

Does anyone know if there's a possibilty to surpress that messagebox? I can't find anything in the official documents.

 

Here is the complete code:

Form::prePrint - (JavaScript, client) //prevent printing xfa.event.cancelAction = 1; // get print settings from acrobat var pp = event.target.getPrintParams(); // shrink to fit pp.pageHandling = pp.constants.handling.shrink; // duplex var nRtn = xfa.host.messageBox("Soll dieses Formular im Duplexmodus gedruckt werden?", cProjekttitel.value, 2, 2); if (nRtn == 4){pp.DuplexType = pp.constants.duplexTypes.DuplexFlipLongEdge;} // print event.target.print(pp);

 

Regards,
Axel

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by radzmar

Unfortunately you can't suppress that abort message.

1 reply

radzmar
radzmarAccepted solution
Level 10
July 20, 2021

Unfortunately you can't suppress that abort message.

axel1982Author
Level 2
July 21, 2021
Thank you radzmar, now i have clarity.