PDF is password protected although no password was specified
Hi,
I am programmatically rendering a pdf document from XSL-FO using FOP and now I want to disable copying and editing in it.
I am setting my encryption-params, but although I am not specifying a user password the file produced says it is password protected and it is asking for a password.
I ve tried:
foUserAgent.getRendererOptions().put("encryption-params", new PDFEncryptionParams( "password", "", true, false, false, false));
foUserAgent.getRendererOptions().put("encryption-params", new PDFEncryptionParams( "password", null, true, false, false, false));
and also
PDFEncryptionParams params = new PDFEncryptionParams();
params.setOwnerPassword("password");
params.setAllowCopyContent(false);
params.setAllowEditContent(false)
params.setAllowEditAnnotations(false);
foUserAgent.getRendererOptions().put("encryption-params", params);
Am I doing something wrong?