cancel
Showing results for 
Search instead for 
Did you mean: 

How to give "Commenting" rights to a PDF document

Former Member
0 Kudos

Hi,

The PDF document that got generated from my webdynpro application does not have the commenting ability (File -> Document Properties -> Security -> Commenting). How to give this right to the document. Appreciate if some one could provide the API or code snippet.

Thanks

Ram

Accepted Solutions (1)

Accepted Solutions (1)

Sigiswald
Contributor
0 Kudos

Hi Ram,

In NW2004, if it can be done, it's by using the PDFObject API, more in particular <a href="https://help.sap.com/javadocs/NW04/current/wd/com/sap/tc/webdynpro/pdfobject/api/WDInteractiveFormPermissionModes.html">WDInteractiveFormPermissionModes</a>.

In NW2004s it's the PDFDocument API. See <a href="https://help.sap.com/javadocs/NW04S/current/wd/com/sap/tc/webdynpro/clientserver/adobe/pdfdocument/api/WDPDFDocumentCertificatePermission.html#FORM_FIELDS_AND_COMMENTS">FORM_FIELDS_AND_COMMENTS</a>.

The next question you're likely about to ask is how and where to use this API. I'm afraid I don't know that answer either...

Kind regards,

Sigiswald

Former Member
0 Kudos

Hi Sigiswald,

Thanks for the response. I could achieve this by writing the below code in wdDoModifyView() method:

IWDPDFDocumentInteractiveFormHandler documentIFHandler =

WDPDFDocumentFactory.getDocumentHandler(view.getContext().getController(), "InteractiveForm");

IWDPDFDocumentInteractiveFormContext documentIFContext = documentIFHandler.getDocumentContext();

documentIFContext.setDynamic(true);

documentIFContext.setCertification(

null,

null,

null,

null,

null,

null,

WDPDFDocumentCertificatePermission.FORM_FIELDS_AND_COMMENTS);

However, my form is loosing the dynamic behaviour if I am adding the certificate permissions.

Does anybody know how to give both commenting and dynamic behaviour to the form?

Thanks

Ram

Sigiswald
Contributor
0 Kudos

Hi Ram,

You use the <i>setCertification</i> method. From the <i>WDPDFDocumentCertificatePermission</i> javadocs: <i>Permission modes depicts what can be changed by the user without breaking the certificate.</i>

Is this really what you need? Note 894389, <i>Release restrictions of SAP NetWeaver 2004s - Adobe document services</i>, mentions <b>No use of digital signatures and certification in dynamic PDF forms</b>: <i>SAP strongly recommends not to use digital signatures and certification in dynamic PDF forms. Dynamic PDFs can be used as of Adobe Acrobat 7 or Adobe Reader 7. The layout of a form of this type has a dynamic structure. The layout of the form can change at runtime, while it is being displayed in Adobe Reader. Dynamic layout changes can include, for example, table rows being added to or removed from a purchase order, or fields being revealed or hidden, as specified by a script. It is not guaranteed that Adobe Reader displays the correct document version that was signed digitally or certified.

( Changed at 04.09.2006 )</i>

Maybe you rather need to use <i>setProtection</i>.


WDPDFDocumentProtectPermission[] permissions = {
  WDPDFDocumentProtectPermission.CHANGES_EDIT_NOTES_FILL_AND_SIGN };
IWDPDFDocumentInteractiveFormHandler handler =
  WDPDFDocumentFactory.getDocumentHandler(
    view.getContext().getController(),
    "InteractiveForm");
IWDPDFDocumentInteractiveFormContext ctx = handler.getDocumentContext();
ctx.setProtection(null, null, permissions);

Kind regards,

Sigiswald

Answers (0)