Encryption is not working when we apply pdf compliance in save option

Below is the source code which we tried:

var dir = "/Users/sgovindan/RiderProjects/aspose-word/aspose-word/Docs/";

// Initialize license object
Aspose.Words.License WordLicense = new Aspose.Words.License(); 

// Set license
WordLicense.SetLicense(dir + "Aspose.Total.Product.Family.lic");
        
// Open the document
Document doc = new Document(dir + "aws.docx");
        
var options = new PdfSaveOptions();
PdfEncryptionDetails encryptionDetails =  new PdfEncryptionDetails("password", "sathish");
 
encryptionDetails.Permissions = PdfPermissions.DisallowAll;
options.EncryptionDetails = encryptionDetails;
        
options.Compliance = PdfCompliance.PdfA1b;
        
doc.Save(dir + "Transformed.pdf", options);

We are using latest aspose.words

 <PackageReference Include="Aspose.Words" Version="23.5.0" />

This is our input file: aws.docx (24.0 KB)

And Output file generated which is losing encryption because of defect in Aspose.word lib: Transformed.pdf (25.2 KB)

But when there is no compliance added encryption is working as expected. Please try this issue and let us know what is going wrong

@sarathisathish90 This is not a bug. Encryption is prohibited by PDF/A compliance. So EncryptionDetails are ignored when saving to PDF/A. This is is a limitation of PDF/A compliance.