Adobe PDF Portable Document Format is widely recognised as a preferred method for capturing and sending electronic documents in exactly the intended format. You can protect PDFs and limit copying, printing or even password protect opening them, but right now you can't set them to 'expire' so that they can't be opened / read past a certain date. That's a really handy feature if you are sending a document like an offer / proposal that is time dependent. You might also want to limit the documents reach to undesirables / third parties that may be looking to use your spec / intellectual property and rip-off your content.The following Javascript approach to expiring a PDF document has it's limitations (which I'm purposefully not going to outline), but it does provide a neat interim approach to this problem.

Here's how to expire your PDF on a certain date | Open a Dialog and then automatically Close

1. Create your PDF ('Print as PDF' is a quick way to do this outside of Adobe')

2. Open up your PDF in Adobe Acrobat Pro DC (Part of Adobe Creative Suite and required for this advanced editing)

3. Click on 'Tools' and then 'Javascript' - Add

adobe-acrobat-add-javascript

4. In the Javascript Menu click on 'Document JavaScripts'

adobe-acrobat-document-javascripts

5. This opens up the Document Javascript Dialog now under 'Script Name' Add the name 'Expiry' and click 'Add'

adobe-acrobat-document-javascript

6. In the JavaScript Editor delete everything so that it's blank and then enter the following JavaScript

7. On the 4th line of the code change the date of format "dd/mm/yyyy" to the expiry date that suits your needs and then enter your own message from line 13 (including updating the email address) and click 'OK'

adobe-acrobat-document-javascript-editor

That completes the code for the expiry and will open the expiry message when the date entered is passed and will then close the document, however we still need to protect the PDF.

8. To protect your document on save Go to 'File > Properties'  and click on the 'Security' tab

9. Change the 'Security Method' to Password Security and then select your Security Restrictions. We generally don't want people to Copy / Edit the Text, but we do want them to Print in High Resolution so we set our documents up like so:-

adobe-acrobat-password-security-settings

10. Once you have made your selections add in the 'Change Permissions Password' and click 'OK'. You will then be prompted to '.. confirm the Permissions Password' and then hit 'OK' and come out of the Document Properties by clicking 'OK' again.

11. Now go to File > Save As and Save your document. You are now done and can close your time dependent PDF document for distribution.

This is the finished article which will close shortly after the prompt is displayed:-

adobe-acrobat-pdf-with-expiry

Works with other PDF Software

You can also use this code to expire PDFs in other software. Our users have fond this to work in:-

  • Expire PDF in Nitro Pro

Please let us know in the comments below if you have been able to expire a PDF in other software.