How can i set using c# when the PDF file should be expired?
PDF Expiration Date
Re: PDF Expiration Date
Support · May 23, 2013Hello,
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.
Re: PDF Expiration Date
Forum member · Oct 15, 2013how to add expiry date to pdf using php. please suggest me working code.
Re: PDF Expiration Date
Support · Oct 16, 2013Hello,
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.
Re: PDF Expiration Date
Forum member · Aug 30, 2017I need to set an expiry date in PDF file from our PHP based application. Can you help me with this?
Re: PDF Expiration Date
Support · Aug 31, 2017Hello,
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.