We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Expired PDF can be opened - ThermoFisher Scientific

Hi I am from ThermoFisher Scientific and we bought License from ASPOSE but not able to get how to get the Proper support from Aspose support team.
Please let us know what is the proper channel to get the support for Licensed user, we also paid for support too.

Here is Problem we are facing:

we are trying to set expiration to PDF File and do not want the file contents to be read by the users using any Other Application. Below is the code used for setting the expiration. File gets closed in Adobe Reader but can be accessed normally via Chrome/Edge etc. Please provide us with fix so that expired file cannot be opened. Also please let us know if there is any other possible way to avoid users from reading the file contents using any application.

Sample Code:

Document doc = new Document();
java.time.LocalDate date1=java.time.LocalDate.now().minusDays(10);
int year = date1.getYear();
int mon=date1.getMonthValue();
int dated=date1.getDayOfMonth();
JavascriptAction javaScript = new JavascriptAction(
“// Get the current date and time\n” +
“var rightNow = new Date();\n” +
“var endDate = new Date(2021, 03, 01);\n” +
“if(rightNow > endDate)\n” +
“{\n” +
“app.alert(“This Document has Expired.”);\n” +
“this.closeDoc();\n” +
doc.save(dataDir + “PDFExpiry.pdf”);

Please advice.

Sanjaya Karigar


A similar issue has already been logged in our issue tracking system under the ticket ID PDFJAVA-40539. We have linked it with this forum thread so that you will be able to receive a notification as soon as it is resolved.

You can request at Paid Support Helpdesk to escalate the priority of this issue.

@mudassir.fayyaz Its been 5days we did not received any update on this request.

Dont you think Aspose will provide the support who bought the licensed tool ?


Can you please confirm if you have purchased the subscription to Paid Support? If yes then you should be able to login there using the same email address which was used for purchasing. In case you are facing any issue, please explain your issue by creating a post in our Purchase Forum where you will be assisted accordingly.

Otherwise, it was logged in free support model and will be investigated and resolved on a first come first serve basis. We will surely inform you as soon as we make some definite progress towards its resolution. Please be patient and spare us some time.

Hi @mudassir.fayyaz,

We have purchased the Aspose tool recently - so that the support for licensed tool will fall under which paid service or free service support?

Please provide the customer support telephone number .

We did purchased the tool with “monica.goomber@thermofisher.com” email, even for Monica also not able raise ticket paid support.

Please help.

Sanjaya Karigar


That means you are not subscribed to Paid Support but only Free Support. In case you paid for it, you can create a post in our Purchase Forum. We will let you know once the issue will be fixed. Please spare us some time.

That means you guys will not give the support the customer who purchased your tool, am I right ?

Please provide the customer support number so that I can talk to them to get the clear details on the supporting structure.

Thanks in advance!

1 Like


We offer Free Support for every customer and Forums are the only medium for communication because of the efficiency. You can post a query at the Purchase forum about details of Paid Support if you are interested. Our concerned team will assist you further in this regard.


Regarding earlier logged ticket, we have investigated it. Please note that there is a reason why .closeDoc(); or window.close(); do not work in the browsers - these methods are designed to close the standalone version of Adobe Reader/Acrobat.

In a browser, you use Adobe Reader as a plug-in, Chrome’s PDF viewer, pdf.js in Firefox, or any other PDF viewer.

And you need to close the browser window from a PDF document. Please take into account that PDF documents do not have the privilege to control your browser. That could be a serious security issue.

closeDoc method does not work in web browsers due to security limitations. It is not feasible to control privileges using JavaScript.

The browser does not allow this behavior. Javascript can only close a tab that it opened. It is guaranteed that the closing of tabs will not be tolerated in any future browsers.

But you can protect his documents using a password:

Document doc = new Document();
PdfFileSecurity security = new PdfFileSecurity(doc);
security.encryptFile("pass1", "pass2", DocumentPrivilege.getAllowAll(), KeySize.x40);
security.save(dataDir + "PDFExpiry_21_8__Encripted.pdf");