Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

MessageBox after event prePrint – cancelEvent

Avatar

Level 2

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

1 Accepted Solution

Avatar

Correct answer by
Level 10

Unfortunately you can't suppress that abort message.

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

Unfortunately you can't suppress that abort message.