cancel
Showing results for 
Search instead for 
Did you mean: 

Cant add an Open Password to the PDF form being generated

Former Member
0 Kudos

Hi,

I'm generating a series of Adobe Interactive Forms using data pulled from R3 via BAPIs. The PDFs are created without an issue but I want to put an Open Password on them (a password the user must enter in order to open the PDF).

From my reading of the APIs the following code should do this, however it doesn't. The PDF which is created simply has no password protection at all.

Does anyone have any suggestions?


		  IWDPDFDocumentCreationContext creationContext = WDPDFDocumentFactory.getDocumentHandler().getDocumentCreationContext();
		  creationContext.setTemplate(templateSourceOutputStream);
		  creationContext.setData(dataSourceOutputStream);
		  creationContext.setDynamic(true);
		  creationContext.setProtection("openpasswordalias", null, null);
		  IWDPDFDocument pdfDoc = creationContext.execute();

Edit: Further investigation led to this (old) thread:

It states that adding an Open Password is not possible with SAP alone. Can anyone tell me if this is still the case?

Edited by: David Michell on May 9, 2008 9:09 AM

Accepted Solutions (0)

Answers (1)

Answers (1)

kmoore007
Active Contributor
0 Kudos

Any updates on this thread? I also have the requirement to password protect an PDF form so it cannot be opened without a password.

Former Member
0 Kudos

Unfortunately nothing conclusive so far. I initially submitted a customer message to SAP on May 9th, 2008 and it has been batted back and forth between half a dozen people within SAP and myself since that date. The most informative (and encouraging) message I received was:

"Because of security reason (technically it is possible to set Open

password to PDF. But only static password can be applied. You can not

change password.), we are not able to support setProtection method."

I replied by asking how to set the open password to a static password (since that is better than nothing) but so far I have not received a useful response.

Former Member
0 Kudos

Hi David,

this functionality is not available in the API.

The "static password" is actualy a random password that is used to implement the printable and changerestricted parameteres of a rendering call to the PDF object.

You could check the class CL_FP_PDF_OBJECT method SET_TASK_RENDERPDF for details.

Regards,

Juergen