PDF Expiration Date

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF Merger for .NET (v7.x)  /  Display Thread

DynamicPDF Merger for .NET (v7.x) Forum

 May 23 2013 4:45 AM
How can i set using c# when the PDF file should be expired?
 May 23 2013 10:30 AM
Posted by a ceTe Software moderator
Hello,

Yes, you can set the Expiry date to the already existing PDF document using our DynamicPDF Merger for .NET product. You will need to use the JavaScript and add the JavaScript to the MergeDocument object using Add method of the JavaScripts class . Below is the sample code for it.

           // Create a PDF Document
            PdfDocument pdf = new PdfDocument(@"C:\Input.pdf");
            MergeDocument document = new MergeDocument(pdf);
            //add the java script to the string
            string expiryDate = "var LastDay = 22; var LastMonth = 05; var LastYear = 2013; " +
                         " var today = new Date(); " +
                         " var myDate=new Date(); " +
                         " LastMonth = LastMonth - 1; " +
                         " myDate.setFullYear(LastYear,LastMonth,LastDay); " +
                         " if (myDate<today) " +
                         " {app.alert(\"This file is expired\"); this.closeDoc(1);} ";
            document.JavaScripts.Add(new DocumentJavaScript("js", expiryDate));
            document.Draw(@"C:\Output.pdf");

Thanks,
ceTe Software Support Team.
 Oct 15 2013 8:59 AM
how to add expiry date to pdf using php. please suggest me working code.
 Oct 16 2013 1:11 PM
Posted by a ceTe Software moderator
Hello,

Currently we do not have any sample code to use any of our products with PHP and we have not tested our products using PHP.

Thanks,
ceTe Software Support Team.
 Aug 30 2017 1:48 PM
I need to set an expiry date in PDF file from our PHP based application. Can you help me with this?
 Aug 31 2017 3:58 PM
Posted by a ceTe Software moderator
Hello,

We don’t have any products that support PHP environment and we have not tested this or any other product of ours in PHP. Since this is a .NET product, all code provided in the documentation is either C# or VB.NET and there are no PHP code samples available.

Thanks,
ceTe Software Support Team.

All times are US Eastern Standard time. The time now is 1:58 PM.