The Forms service can render forms that have usage rights applied to them. Usage rights pertain to functionality that is available by default in Acrobat but not in Adobe Reader, such as the ability to add comments to a form or to fill in form fields and save the form. Forms that have usage rights applied to them are called rights-enabled forms. A user who opens a rights-enabled form in Adobe Reader can perform operations that are enabled for that form.
In order to apply usage rights to a form, the Acrobat Reader DC extensions service must be part of your AEM forms installation. Also, you must have a valid credential that enables you to apply usage rights to PDF documents. That is, you must properly configure the Acrobat Reader DC extensions service before you can render a rights-enabled form. (See About the Acrobat Reader DC extensions Service.)
To render a form that contains usage rights, you must use an XDP file as input, not a PDF file. If you use a PDF file as input, the form is still rendered; however, it will not be a rights-enabled form.
You cannot prepopulate a form with XML data when you specify the following usage rights: enableComments
, enableCommentsOnline
, enableEmbeddedFiles
, or enableDigitalSignatures
. (See Prepopulating Forms with Flowable Layouts.)
For more information about the Forms service, see Services Reference for AEM Forms.
To render a rights-enabled form, perform the following tasks:
Include project files
Include necessary files into your development project. If you are creating a client application using Java, include the necessary JAR files. If you are using web services, ensure that you include the proxy files.
Create a Forms Client API object
Before you can programmatically perform a Forms service Client API operation, you must create a Forms service client.
Set usage rights run-time options
You must set usage rights run-time options to render a rights-enabled form. You must also specify the alias of the credential that is used to apply usage rights to a form. After you specify the alias value, you specify each usage right to apply to the form.
Render a rights-enabled form
To render a rights-enabled form, you use the same application logic as rendering a form without usage rights. The only difference is that you must ensure that the usage rights run-time options are included in your application logic.
When rendering a rights-enabled form using the Forms web service API, you cannot attach files to the form.
Write the form data stream to the client web browser
When the Forms service renders a rights-enabled form, it returns a form data stream that you must write to the client web browser. Once written to the client web browser, the form is visible to the user. A user viewing the rights-enabled form in Adobe Reader is able to perform operations that are enabled for that form.
See also
Render rights-enabled forms using the Java API
Render rights-enabled forms using the web service API
Including AEM Forms Java library files
Forms Service API Quick Starts
Rendering Interactive PDF Forms
Creating Web Applications that Renders Forms
Render a rights-enabled form by using the Forms API (Java):
Include project files
Include client JAR files, such as adobe-forms-client.jar, in your Java project’s class path.
Create a Forms Client API object
ServiceClientFactory
object that contains connection properties.FormsServiceClient
object by using its constructor and passing the ServiceClientFactory
object.Set usage rights run-time options
ReaderExtensionSpec
object by using its constructor.ReaderExtensionSpec
object’s setReCredentialAlias
method and specify a string value that represents the alias value.ReaderExtensionSpec
object. However, you can only set a usage right if the credential that you reference allows you to do so. That is, you cannot set a usage right if the credential does not allow you to set it. For example. to set the usage right that enables a user to fill in form fields and save the form, invoke the ReaderExtensionSpec
object’s setReFillIn
method and pass true
.It is not necessary to invoke the ReaderExtensionSpec
object’s setReCredentialPassword
method. This method is not used by the Forms service.
Render a rights-enabled form
Invoke the FormsServiceClient
object’s renderPDFFormWithUsageRights
method and pass the following values:
Applications/FormsApplication/1.0/FormsFolder/Loan.xdp
.com.adobe.idp.Document
object that contains data to merge with the form. If you do not want to merge data, pass an empty com.adobe.idp.Document
object.PDFFormRenderSpec
object that stores run-time options.ReaderExtensionSpec
object that stores usage rights run-time options.URLSpec
object that contains URI values that are required by the Forms service.The renderPDFFormWithUsageRights
method returns a FormsResult
object that contains a form data stream that must be written to the client web browser.
Write the form data stream to the client web browser
com.adobe.idp.Document
object by invoking the FormsResult
object ‘s getOutputContent
method.com.adobe.idp.Document
object by invoking its getContentType
method.javax.servlet.http.HttpServletResponse
object’s content type by invoking its setContentType
method and passing the content type of the com.adobe.idp.Document
object.javax.servlet.ServletOutputStream
object used to write the form data stream to the client web browser by invoking the javax.servlet.http.HttpServletResponse
object’s getOutputStream
method.java.io.InputStream
object by invoking the com.adobe.idp.Document
object’s getInputStream
method.InputStream
object’s read
method and passing the byte array as an argument.javax.servlet.ServletOutputStream
object’s write
method to send the form data stream to the client web browser. Pass the byte array to the write
method.See also
Quick Start (SOAP mode): Rendering a rights-enabled form using the Java API
Including AEM Forms Java library files
Render a rights-enabled form by using the Forms API (web service):
Include project files
Create a Forms Client API object
Create a FormsService
object and set authentication values.
Set usage rights run-time options
ReaderExtensionSpec
object by using its constructor.ReaderExtensionSpec
object’s setReCredentialAlias
method and specify a string value that represents the alias value.ReaderExtensionSpec
object. However, you can only set a usage right if the credential that you reference allows you to do so. That is, you cannot set a usage right if the credential does not allow you to set it. To set the usage right that enables a user to fill in form fields and save the form, invoke the ReaderExtensionSpec
object’s setReFillIn
method and pass true
.Render a rights-enabled form
Invoke the FormsService
object’s renderPDFFormWithUsageRights
method and pass the following values:
Applications/FormsApplication/1.0/FormsFolder/Loan.xdp
.BLOB
object that contains data to merge with the form. If you do not want to merge data with the form, you must pass a BLOB
object that is based on an empty XML data source. You cannot pass a BLOB
object that is null; otherwise, an exception is thrown.PDFFormRenderSpec
object that stores run-time options.ReaderExtensionSpec
object that stores usage rights run-time options.URLSpec
object that contains URI values that are required by the Forms service.The renderPDFFormWithUsageRights
method returns a FormsResult
object that contains a form data stream that must be written to the client web browser.
Write the form data stream to the client web browser
BLOB
object that contains form data by invoking the FormsResult
object’s getOutputContent
method.BLOB
object by invoking its getContentType
method.javax.servlet.http.HttpServletResponse
object’s content type by invoking its setContentType
method and passing the content type of the BLOB
object.javax.servlet.ServletOutputStream
object used to write the form data stream to the client web browser by invoking the javax.servlet.http.HttpServletResponse
object’s getOutputStream
method.BLOB
object’s getBinaryData
method. This task assigns the content of the FormsResult
object to the byte array.javax.servlet.http.HttpServletResponse
object’s write
method to send the form data stream to the client web browser. Pass the byte array to the write
method.See also
Rendering Rights-Enabled Forms
Invoking AEM Forms using Base64 encoding