I am using the code below to semi-protect the generated PDFs, hundreds of 
these are being generated but in the past three months I have (just) two 
instances where the PDF cannot be opened (in adobe or pdfxchange) because 
it prompts for a password.


-----------------------------------------------------------------
        public void lockDown(String owner_pwd) throws 
BadSecurityHandlerException {
                AccessPermission ap = 
document.getCurrentAccessPermission();
                logger.info("locking down  ");
                ap.setCanModify(false);
                ap.setCanAssembleDocument(false);
                ap.setCanExtractContent(false);
                ap.setCanFillInForm(false);
                ap.setCanModifyAnnotations(false);
                ap.setReadOnly();
                StandardProtectionPolicy policy = new 
StandardProtectionPolicy(owner_pwd, null, ap);
                //policy.
                document.protect(policy);
                logger.info("locked");
        }
-----------------------------------------------------------------

I'm failrly sure (though I could be wrong) that the application is not 
responsible for, as you can see, the user password is hard-coded and null.

Any ideas

Steve Lindsey

Reply via email to