Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

Can I have a message box pop up at pre-print Livecycle Designer

akgrimes
Level 3
Level 3

I don't have a "print" button programmed on my form.

We want users to save it (I do have "save" buttons) and forward the interactive PDF to others who have sections to complete via email. I have users who, despite education, help links, a general pop up window they can click on for instructions, etc., are printing the form, completing it by hand, scanning it as a new static PDF, and forwarding it -- thus eradicating the interactive commands.

Is there a way to program a message box to pop up when a user tries to print the form, warning about how that action impacts future steps on the process?

I tried a PrePrint event on the master page:

xfa.host.messageBox("This is my message. ", "Do not print", 3);

but that didn't work.

I've searched online for answers, but what I can find all links back to requiring mandatory fields to be completed before a form can be printed. Our form won't necessarily be completed at the point someone wants to print it -- it has several steps before all the fields will be completed. Requiring all mandatory fields be completed before printing won't achieve what I need.

Can this be done?

7 Replies
jnicholas330
Level 7
Level 7

I believe you can disable printing in Acrobat/Reader by applying Restricting Features under Security.

PDFGuru
Level 4
Level 4

The Pre Print script will run if you put it under form root. see the example at Dropbox - PrePrint.pdf

PrePrint.JPG

PDFGuru
Level 4
Level 4

also if you want we can disable the printing as well.

akgrimes
Level 3
Level 3

That didn't work -- no message box popped up when my script looked like this--went straight to print dialog box:

form1::prePrint - (JavaScript, client)

xfa.host.message box ("This is my message. ", "Do not print", 3);

I don't want to completely disable printing -- at the very, very end, when everything is completed, they can print a hard copy for a file if they want. I just don't want them to print it and start doing the worklow "offline."

akgrimes
Level 3
Level 3

Thank you, thank you, thank you PDFGuru. Not sure how I had messed up the script, but I so appreciate your help fixing it.

Magus069
Level 10
Level 10

Hi there,

don't forget the capital letter 'B' of box when calling the method messageBox() like the following :