Expand my Community achievements bar.

SOLVED

prevent save and print option

Avatar

Level 2

Hi experts

Is there any way to prevent save and print options based on conditions.

Example:

if(textfield1.rawValue == "user1")

{

// this pdf should not be saved and should not be printed

}

is there any way to achieve this?

Thanks

Regards

arul

1 Accepted Solution

Avatar

Correct answer by
Level 10

The saving cannot be stopped by the cancelAction or other methods.

The older LiveCycle documentation indeed says it is possible with the preSave event, but it's was a bug of the documentation.

Here a comment from Stefan Cameron's blog:

http://forms.stefcameron.com/2008/04/13/prevent-printing-pdf-forms-in-acrobat-8/

preSave: Failed validations will not prevent the form from being saved however Acrobat/Reader will issue a special warning message, after issuing the validation error message, to inform the user that the validations failed. I’m guessing this is because the user may be saving the form to continue filling it at a later time so the save can’t be completely prevented.

View solution in original post

6 Replies

Avatar

Level 10

Write the following code in the prePrint event of the form

if(txtUser.rawValue == "user1")

{

     xfa.event.cancelAction = true;     // this will prevent saving the form

}

Nith

Avatar

Level 2

Hi radzmar and $Nith$

Thank you so much for your codes i will work with this.

Thanks again

Avatar

Level 7

Just be careful with cancelAction as there is a bug in Reader 10.0 where cancelAction cancels all your code not just the action it is assigned to. See this thread: http://forums.adobe.com/message/3852614#3852614

Avatar

Level 2

Hi $Nith$

I have just workout your code but it wont works for me. can you please look into this file. since this is a dynamic PDF form only.

http://www.4shared.com/document/GJoXSkUF/test.html

While the user name is John, the form wont allow to print function.
thanks in advance

Avatar

Correct answer by
Level 10

The saving cannot be stopped by the cancelAction or other methods.

The older LiveCycle documentation indeed says it is possible with the preSave event, but it's was a bug of the documentation.

Here a comment from Stefan Cameron's blog:

http://forms.stefcameron.com/2008/04/13/prevent-printing-pdf-forms-in-acrobat-8/

preSave: Failed validations will not prevent the form from being saved however Acrobat/Reader will issue a special warning message, after issuing the validation error message, to inform the user that the validations failed. I’m guessing this is because the user may be saving the form to continue filling it at a later time so the save can’t be completely prevented.