Hi all,
one of our workflows generates word document which needs then to be converted to PDF and then sent to browser without a possibility to print it.
We were able to achieve it using older Aspose.Words and Aspose.Pdf libraries and Aspose.Pdf.Generator.Security object:
var fileSecurity = new Security {IsPrintingAllowed = false};
Today we work with Aspose.Words 13.5.0.0 and:
we want to change our code according to - but we have a problem how to prohibit the printing
Can you advice how to do it with Aspose.Words 13.5.0.0?
Thanks.
Mirek
Following code example demonstrates how to set permissions on a PDF document generated by Aspose.Words.
Document doc = new Document(MyDir + "Rendering.doc");
PdfSaveOptions saveOptions = new PdfSaveOptions();
// Create encryption details and set owner password.
PdfEncryptionDetails encryptionDetails = new PdfEncryptionDetails(string.Empty, "password", PdfEncryptionAlgorithm.RC4_128);
// Start by disallowing all permissions.
encryptionDetails.Permissions = PdfPermissions.DisallowAll;
// Extend permissions to allow editing or modifying annotations.
encryptionDetails.Permissions = PdfPermissions.ModifyAnnotations | PdfPermissions.DocumentAssembly;
saveOptions.EncryptionDetails = encryptionDetails;
// Render the document to PDF format with the specified permissions.
doc.Save(MyDir + "Rendering.SpecifyPermissions Out.pdf", saveOptions);
Hope this helps you. Please let me know if I can be of any further assistance.