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.
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.
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.