Passwords, Security & Metadata
IronPDF 可修改 PDF 的元資料與安全性設定。 在安全性方面,這包括將 PDF 設定為唯讀、禁止列印、密碼保護及加密等功能。 就元資料而言,這包含定義新屬性及編輯現有屬性的能力。
To manage a PDF's metadata in IronPDF for Java, the developer must first retrieve a reference to its MetadataManager. 此類別提供用於直接存取及修改 PDF 元資料的方法。 開發人員可透過同名的存取器與設定器,快速讀取及編輯 PDF 文件中已定義的常用元屬性。
以下是附帶便捷取得器與設定器的完整屬性清單:
ProducerCreationDateCreatorAuthorKeywordsSubjectTitleModifiedDate
The code example uses the setAuthor, setTitle, setKeywords, and setModifiedDate methods to modify the working document's author, title, and keywords.
To get and set properties other than the ones previously listed, use the getAnyMetadata and setAnyMetadata methods with the name of the desired property.
Likewise, accessing and modifying security settings on a PDF document must be done through a SecurityManager. Call getSecurity on a PdfDocument to retrieve a reference to its SecurityManager and use it to restrict access to the PDF as required for the intended use.
Java developers can use a SecurityOptions object for more granular control over PDF security settings.


