We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Encrypt PDF document using Aspose.PDF for .NET - Encrypting Fillable form makes it read only

I have a PDF which is a fillable form. When I add encryption the file the fields become read only. Can you please advise how the file can be encrypted while retaining the fields? The code I am using is as follows:

        DocumentPrivilege dp = DocumentPrivilege.AllowAll;
        dp.AllowModifyContents = false;

        using (var stream = new FileStream(fullFileName, FileMode.Open, FileAccess.ReadWrite))
            Document doc = new Document(stream);

            using (PdfFileSecurity fs = new PdfFileSecurity(doc))
                fs.EncryptFile(userPassword, ownerPassword, dp, KeySize.x256);


Thanks for contacting support.

Can you please share source file so that we may further investigate to help you out.

MyFile.pdf (585.1 KB)


I have observed issue you mentioned and have logged it as PDFNET-47790 in our issue tracking system. We will further look into details of the issue and keep you posted with the status of its correction. Please be patient and spare us little time.

We are sorry for the inconvenience.

Could I have an update with regards to this issue please?


I like to inform this issue has been added recently in our issue tracking system and as per our company policy, the first priority for investigation is given to the Paid Support i.e. Enterprise and Priority Support on first come first serve basis. After that the issues from normal support forum are scheduled for investigation on first come first serve basis. I request for your patience and we will share good news with you soon.