密码、安全性和元数据
IronPDF可以修改PDF的元数据和安全设置。 在安全性方面,这包括使PDF为只读、不可打印、受密码保护和加密的能力。 对于元数据,这包括定义新属性和编辑现有属性的功能。
To manage a PDF's metadata in IronPDF for Java, the developer must first retrieve a reference to its MetadataManager. 此类提供直接访问和修改PDF元内容的方法。 开发人员可以通过使用同名的getter和setter快速读取和编辑PDF文档上定义的常用元属性。
下面是具有便捷getter和setter的完整属性列表:
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.






