Free Support Forum - aspose.com

Disable the PDF print

Hi,

We are trying to use the aspose.words for the docx conversion to the pdf(aspose-words-14.11.0-jdk15.jar) .After converting the pdf need to disable the PDF Print functionality.Please suggest us with out using aspose.pdf jar file because we are planning to use only aspose.words.

Thanks in advance

Hi Mahesh,


Thanks for your inquiry. Please upgrade to the latest version 15.8.0 and use the following code:
Document doc = new Document(getMyDir() + “in.docx”);
PdfSaveOptions saveOptions = new PdfSaveOptions();
PdfEncryptionDetails encryptionDetails = new PdfEncryptionDetails("", “password”, PdfEncryptionAlgorithm.RC_4_128);
encryptionDetails.setPermissions(PdfPermissions.DISALLOW_ALL);
saveOptions.setEncryptionDetails(encryptionDetails);
doc.save(getMyDir() + “15.8.0.pdf”, saveOptions);
I hope, this helps.

Best regards,