i want create pdf can modify equal false , readonly = true without needing password, i.e. can read document , no 1 can modify it. seems policy object forces password , see no method use accesspermission object without policy object. below code tried.
pddocument documenttoprotect= pddocument.load(document); accesspermission ap = new accesspermission(); ap.setcanmodify(false); ap.setreadonly(); standardprotectionpolicy policy = new standardprotectionpolicy(null,null, ap); documenttoprotect.protect(policy);
do this:
standardprotectionpolicy policy = new standardprotectionpolicy("secret", "", ap); this way pdf can opened empty password viewed. user password opening restricted rights, owner password permissions (which want prevent).
Comments
Post a Comment