Hi Igor,
Thank you for your quick response to my request, sent you a license file and a description of the problem.
Hi Igor,
And how to get 9.3.1? The site is available only 4.5.1 and 9.5.2
Hi Igor,
Hi Igor,
Hi,
I have tested the scenario using the following code snippet and have observed that when viewing the PDF file, a prompt for the password appears. For the sake of correction, I have logged it in our issue tracking system as PDFNEWJAVA-34530. We will investigate this issue in detail and will keep you updated on the status of a correction. We apologize for your inconvenience.
[Java]
aspose.pdf.Pdf pdf = new aspose.pdf.Pdf();
pdf.getSections().add();
pdf.setSecurity(new aspose.pdf.Security());
pdf.getSecurity().setCopyingAllowed(false);
pdf.getSecurity().setDefaultAllAllowed(false);
pdf.getSections().get_Item(0).getParagraphs().add(new aspose.pdf.Text("Hello World..."));
pdf.save("c:/pdftest/SecureFile.pdf");
However, as a workaround, you may consider using the following code snippet based on the new Document Object Model (DOM) of com.aspose.pdf package.
[Java]
com.aspose.pdf.Document doc = new com.aspose.pdf.Document();
doc.getPages().add();
doc.getPages().get_Item(0).getParagraphs().add(new com.aspose.pdf.TextFragment("Hello World.. with DOM"));
try {
com.aspose.pdf.facades.DocumentPrivilege documentPrivilege = com.aspose.pdf.facades.DocumentPrivilege.forbidAll();
documentPrivilege.setAllowCopy(false);
documentPrivilege.setAllowPrint(true);
doc.encrypt("", "", documentPrivilege, CryptoAlgorithm.AESx128, false);
doc.save("c:/pdftest/DOM_Secured.pdf");
} finally {
if (doc != null) doc.dispose();
}
The issues you have found earlier (filed as PDFNEWJAVA-34530) have been fixed in Aspose.Pdf for Java 10.1.0.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.