Skip to main content
karth80472045
Inspiring
December 20, 2018
Question

self destructive pdf

  • December 20, 2018
  • 2 replies
  • 8455 views

Hello all,

I would like to write Javascript or VBA code to Make pdf self destructive after specific time (5 mins), when pdf is sent via mail to specific persons.

After 5 mins pdf page should become blank , no contents should not be displayed.

is this possible if possible could anyone please give suggestions how to proceed.

Thanks and Regards,

Yogesh

This topic has been closed for replies.

2 replies

Thom Parker
Community Expert
Community Expert
December 20, 2018

You can't make a PDF self destruct.  You can however make it difficult to view.  One of the problems is that not all viewers support scripting, especially the scripting necessary to obscure PDF content, so a script will only work on compliant viewers, i.e. desktop Acrobat/Reader. 

So there are a few techniques, but they all come down to encrypting or obscuring the PDF upfront. Then some script or tool unlocks the PDF content if some given conditions are true. For example, a watermark can be added to every page that blocks all the content from being viewed. Then a document script hides the watermark on opening if conditions are met.

There's a tutorial and example of this technique here: Lite Document Security

But this method is not foolproof.

The most effective technique for hiding content is to use a service like Lock Lizard or the Adobe Security server, which encrypt the PDF, which is a very high bar to get around.

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
karth80472045
Inspiring
December 21, 2018

hello sir,

Thanks for your suggestions,i will try from my side , do you have any idea on itextsharp pdf  c# coding is possible for this question.

Thom Parker
Community Expert
Community Expert
December 21, 2018

If depends on your strategy for protecting the document. iText is a really good PDF library, so it can be used to add the water mark OCG layer, and it can be used to encrypt PDF content with a digital certificate.

So it can certainly be used to modify the PDF for the protection strategy, but the actual action of blocking the user from seeing content is up to the viewer and it's capabilities.

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
try67
Community Expert
Community Expert
December 20, 2018

It's possible, but there are so many ways around it it's not really worth the trouble of setting it up.