Python での PDF の有効期限の設定
Contents
[
Hide
]
Aspose.PDF Java for Python を使用して Pdf ドキュメントの有効期限を設定するには、単に SetExpiration クラスを呼び出します。
doc= self.Document()
pdf = self.Document()
pdf=self.dataDir + 'input1.pdf'
javascript = self.JavascriptAction(
"var year=2021; 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(self.dataDir + "set_expiration.pdf");
print "Update document information, please check output file."
実行中のコードをダウンロード
ダウンロード:PDF の有効期限の設定(Aspose.PDF)—以下のいずれかのソーシャルコーディングサイトから取得してください。