Set security on pdf conversion

hi,


I’m trying o convert excel file to a pdf file, so then when I set security options on pdf

1. options cannot copy text from it, its not working
Workbook book = new Workbook(excel2);
PdfSaveOptions options = new PdfSaveOptions(SaveFormat.PDF);
options.setDefaultFont(“Arial”);
PdfSecurityOptions sec = new PdfSecurityOptions();
sec.setAnnotationsPermission(false);
sec.setExtractContentPermission(false);
sec.setExtractContentPermissionObsolete(false);
sec.setModifyDocumentPermission(false);
sec.setFillFormsPermission(false);
sec.setAssembleDocumentPermission(false);
sec.setOwnerPassword(“testing”);
options.setSecurityOptions(sec);
book.save(asposse.pdf") options);


Hi,


Thanks for the detail and sample code.

After an initial test, I observed the issue as you mentioned by using your sample code with a simple template Excel file. Disabling setExtractContentPermission - “Permission to copy or extract content” option is not working and I can still copy text from it in the PDF file.
e.g
Sample code:

Workbook book = new Workbook(“e:\test2\Book1.xlsx”);
PdfSaveOptions options = new PdfSaveOptions(SaveFormat.PDF);
options.setDefaultFont(“Arial”);
PdfSecurityOptions sec = new PdfSecurityOptions();
sec.setAnnotationsPermission(false);
sec.setExtractContentPermission(false);
sec.setExtractContentPermissionObsolete(false);
sec.setModifyDocumentPermission(false);
sec.setFillFormsPermission(false);
sec.setAssembleDocumentPermission(false);
sec.setOwnerPassword(“testing”);
options.setSecurityOptions(sec);
book.save(“out1.pdf”, options);

I have logged a ticket with an id “CELLSJAVA-40973” for your issue. We will look into it soon.

Once we have any update on it, we will let you know here.

Thank you.

Hi,

Thanks for using Aspose.Cells for Java.

Please download and try this fix: Aspose.Cells for Java v8.2.0.3 and let us know your feedback.

The issues you have found earlier (filed as CELLSJAVA-40973) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

hi

I downloaded asposecells 8.2.1, so then when I convert excel to pdf and I disable extract content, this option still without working.

I attach the file that I have to convert

Hi,


I have tested your scenario/ case using your newly attached file a bit, it works fine. I am using the following sample code, it works fine regarding security settings for extract content permissions, please see the screen shot here for your reference.
e.g
Sample code:

Workbook book = new Workbook(“67460.xls”);
PdfSaveOptions options = new PdfSaveOptions(SaveFormat.PDF);
options.setDefaultFont(“Arial”);
PdfSecurityOptions sec = new PdfSecurityOptions();
sec.setAnnotationsPermission(false);
sec.setExtractContentPermission(false);
sec.setExtractContentPermissionObsolete(false);
sec.setModifyDocumentPermission(false);
sec.setFillFormsPermission(false);
sec.setAssembleDocumentPermission(false);
sec.setOwnerPassword(“testing”);
options.setSecurityOptions(sec);
book.save(“out674601.pdf”, options);

Please make sure that you are using the latest version i.e., v8.2.1.

Thank you.



Hi,

Sorry I have a mistake in develop, now it’s working fine

Thanks a lot.

Hi Diego,

Thanks for your feedback and using Aspose.Cells.

It is good to know that your issue is resolved with the latest fix. Let us know if you encounter any other issue, we will be glad to look into it and help you further.