Hi,

I've been trying to make a PDF read-only using the following code:

[snip]
PDDocument documentInstance = PDDocument.load( pdfStream );
// acroform modifications goes here
AccessPermission accessPerm = new AccessPermission();
accessPerm.setReadOnly();
accessPerm.canFillInForm( false );
accessPerm.canModify( false );
accessPerm.canModifyAnnotations( false );
ProtectionPolicy policy = new StandardProtectionPolicy( "secret", "",
accessPerm );
documentInstance.protect( policy );
[snap]

However this really does nothing. Have I totally misunderstood the
documentation and if so please point me in the right direction.

BR,

Ian Johannesen


Reply via email to