Mengatur kedaluwarsa PDF di PHP
Contents
[
Hide
]
Aspose.PDF - atur kedaluwarsa PDF
Untuk mengatur kedaluwarsa dokumen PDF menggunakan Aspose.PDF Java for PHP, cukup panggil kelas SetExpiration.
Kode PHP
# Open a pdf document.
$doc = new Document($dataDir . "input1.pdf");
$javascript = new JavascriptAction(
"var year=2014;
var month=4;
today = new Date();
today = new Date(today.getFullYear(), today.getMonth());
expiry = new Date(year, month);
if (today.getTime() > expiry.getTime())
app.alert('The file is expired. You need a new one.');");
$doc->setOpenAction($javascript);
# save update document with new information
$doc->save($dataDir . "set_expiration.pdf");
print "Update document information, please check output file." . PHP_EOL;
Mengunduh kode yang dapat dijalankan
Unduh Set PDF Expiration (Aspose.PDF) dari salah satu situs coding sosial yang disebutkan di bawah: