MessageBox after event prePrint – cancelEvent

Avatar

Avatar
Validate 1
Level 1
axel1982
Level 1

Likes

0 likes

Total Posts

4 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Give Back
Ignite 1
View profile

Avatar
Validate 1
Level 1
axel1982
Level 1

Likes

0 likes

Total Posts

4 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Give Back
Ignite 1
View profile
axel1982
Level 1

23-06-2021

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

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Coach
MVP
radzmar
MVP

Likes

397 likes

Total Posts

2,687 posts

Correct reply

492 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile

Avatar
Coach
MVP
radzmar
MVP

Likes

397 likes

Total Posts

2,687 posts

Correct reply

492 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
MVP

20-07-2021

Unfortunately you can't suppress that abort message.

Answers (0)