Can't remove restrictions from pdf file

Hello,

I’m using this article How to Remove All Restrictions from PDF in C# to remove all restrictions but it’s not doing nothing.

The actual code I’m using is :

public void MssRemoveSecuritySettings(byte[] ssLicense, byte[] ssFile, string ssPassword, out bool ssResult, out string ssResultMessage, out byte[] ssOutFile) {

    ssOutFile = new byte[] { };
    ssResult = false;
    ssResultMessage = "";

    try
    {
        setPdfLicense(ssLicense);
        MemoryStream inStream = new MemoryStream(ssFile);

        // Create PdfFileSecurity object
        PdfFileSecurity fileSecurity = new PdfFileSecurity();
        fileSecurity.BindPdf(inStream);

        // empty password?
        if (!string.IsNullOrEmpty(ssPassword))
        {
            // decrypt if we have password
            fileSecurity.DecryptFile(ssPassword);
        }

        // Create DocumentPrivileges object
        var privilege = DocumentPrivilege.AllowAll;

        // Set Privilege
        fileSecurity.SetPrivilege(privilege);    

        MemoryStream OutStream = new MemoryStream();
        fileSecurity.Save(OutStream);

        ssOutFile = OutStream.ToArray();
        ssResult = true;
        ssResultMessage = "Success";
    }
    catch (Exception e)
    {
        ssResult = false;
        ssResultMessage = e.Message;
    }
}

The output file has the same restrictions as the input file.

Our example file has :
Security Method : Password Security
Document Assembly : Not Allowed
age Extraction : Not Allowed

And we wanted to allow both.

@nelsonandre

Would you kindly share your sample PDF document for our reference so that we can test the scenario in our environment and address it accordingly.

ProtectedFile_teste44.pdf (34.5 KB)

Hello,
here is an example.
The password is teste44

@nelsonandre

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PDFNET-56963

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.