0

I have a PDF form and I need to prevent printing this PDF form, if its fields are blank.

To modify my form i user Adobe LiveCycle Designer ES3.

About how can this be done is written here: http://forms.stefcameron.com/2008/04/13/prevent-printing-pdf-forms-in-acrobat-8/

The only thing i need more than in this article - is to suppress message "Printing Cancelled", or overide it with another text.

So, if somebody knows how can it be done, please help me.

Victoria Agafonova
  • 2,048
  • 10
  • 33
  • 50

2 Answers2

0

Do you a print button on the form which is being clicked to print the form ? If you do, then there is a way to suppress the printing. Otherwise, I don't know of any way of solving your issue.

If you do have a print button, add the following code to the click event of the button:

var result = form1.MainPage.execValidate();
        if(result==false){
            xfa.host.messageBox("Please ensure that all validations are complete before printing.");
        }
        else{
            xfa.host.print(1, "0", (xfa.host.numPages -1).toString(), 0, 0, 0, 0, 0);
        }

Where "form1" is the rootnode of the form and "MainPage" is the page which contains all the subforms in your form. the exeValidate() method fires all the validation messages in the form and returns a true if the all validations pass the test. Otherwise it returns false.

Pleaselet me know if you have any other questions.

Thanks, Armaghan.

0

Set your event picker to "PrePrint", Add your validation script.

Enter : xfa.event.cancelAction = (true) at the end of your "If" statement.

Anton
  • 1