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

Free Support Forum - aspose.com

Password protected PDF

Need to understand if Aspose.Words can convert DOCX to password protected PDF


Thanks for your inquiry. Sure, please try run the following code snippet:

Document doc = new Document(MyDir + “Rendering.doc”);

PdfSaveOptions saveOptions = new PdfSaveOptions();<o:p></o:p>

// Create encryption details and set owner password.<o:p></o:p>

PdfEncryptionDetails encryptionDetails = new PdfEncryptionDetails(string.Empty, “password”,PdfEncryptionAlgorithm.RC4_128);<o:p></o:p>

// Start by disallowing all permissions.<o:p></o:p>

encryptionDetails.Permissions = PdfPermissions.DisallowAll;<o:p></o:p>

saveOptions.EncryptionDetails = encryptionDetails;<o:p></o:p>

// Render the document to PDF format with the specified permissions.<o:p></o:p>

doc.Save(MyDir + “Rendering.SpecifyPermissions Out.pdf”, saveOptions);<o:p></o:p>

I hope, this will help.

Best regards,