Adobe Experience Manager Forms Saveas | Community
Skip to main content
New Participant
September 2, 2021
Solved

Adobe Experience Manager Forms Saveas

  • September 2, 2021
  • 1 reply
  • 1516 views

I am facing issue in implementting save/saveas(ok button) button functionality in AEM Form Designer, where as print and reset buttons functionalities are straight forward and easy.

Need help in save/ save as button script.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Kosta_Prokopiu1

@shyamasundar-ks 

as I thought you have a security related issue.

See Designer Scripting Reference (adobe.com) and look for exportData

There it says

For security reasons, if you provide the first parameter, the exportData method executes only
when performed on certified documents. If you do not provide the first parameter, the document
does not need to be certified and the user is prompted to provide a location and filename.

 

Only the user is prompted option will work OOTB. Certification can only be applied on the rendered PDF and you must have a valid certficate to certify. You can certify with Acrobat Pro (or AEM Forms server).

What is you use case here?

1 reply

Kosta_Prokopiu1
Employee
September 2, 2021

Hi @shyamasundar-ks,

what kind of issues?

 

Save functionality is restricted by the Acrobat/Reader security module as the save functionality might be used harmfully.

See JavaScript for Acrobat API Reference (adobe.com) and find saveas function. It has a red S for security. This means (quote):
For security reasons, this property or method may be available only during certain events. These
events include batch processing, application start, or execution within the console. (See the
event object for details of the Acrobat events.)
Beginning with Acrobat 7.0, to execute a security-restricted method through a menu event, one
of the following must be true:
o The JavaScript user preferences item Enable Menu Items JavaScript Execution Privileges is
checked.
o The method is executed through a trusted function. For details and examples, see the
app.trustedFunction method.
See Privileged versus non-privileged context for more information.
Note: (Acrobat 6.0 or later) Methods marked with S will execute without restriction in a certified
document provided the certifier’s certificate is trusted for running embedded high
privilege JavaScript and other limitations in the quick bar fields are met

 

Also, if a form is opened in Adobe Reader (vs Acrobat Pro) you will require "Reader Extensions" to be applied to the PDF so that exporting of data is allowed.

 

New Participant
September 2, 2021

@kosta_prokopiu1 : Thanks for the reply.

form1.#subform[0].Button1::click - (FormCalc, client)
$host.exportData("",1);
xfa.host.exportData("",1);

I have enabled  Enable Menu Items JavaScript Execution Privileges.

Still getting the same security settings error.

 

Kosta_Prokopiu1
Kosta_Prokopiu1Accepted solution
Employee
September 2, 2021

@shyamasundar-ks 

as I thought you have a security related issue.

See Designer Scripting Reference (adobe.com) and look for exportData

There it says

For security reasons, if you provide the first parameter, the exportData method executes only
when performed on certified documents. If you do not provide the first parameter, the document
does not need to be certified and the user is prompted to provide a location and filename.

 

Only the user is prompted option will work OOTB. Certification can only be applied on the rendered PDF and you must have a valid certficate to certify. You can certify with Acrobat Pro (or AEM Forms server).

What is you use case here?