Managing Metadata Visibility in PDFs

This article was translated from English: Does it need improvement?
Translated
View the article in English

元数据类别中可见什么内容?

任何能够打开PDF的人都可以看到元数据。 这些详细信息包括以下项目:

// Assign metadata properties to a PDF document
Pdf.MetaData.Author = "John Doe";  // The author of the document
Pdf.MetaData.Keywords = "Key, Word";  // Keywords associated with the document
Pdf.MetaData.CreationDate = DateTime.Today;  // The date the document was created
Pdf.MetaData.ModifiedDate = DateTime.Now;  // The date and time the document was last modified
Pdf.MetaData.CustomProperties.Add("Test", "val");  // Custom properties for additional metadata
Pdf.MetaData.Producer = "test";  // The software used to produce the document
Pdf.MetaData.Subject = "test metadata";  // The subject of the document
Pdf.MetaData.Title = "test";  // The title of the document
Pdf.MetaData.Creator = "test";  // The original creator of the document

// Security settings for the PDF
Pdf.SecuritySettings.UserPassword = "ironuser";  // Password to open and view the PDF
Pdf.SecuritySettings.OwnerPassword = "ironowner";  // Password providing full permissions, including editing
// Assign metadata properties to a PDF document
Pdf.MetaData.Author = "John Doe";  // The author of the document
Pdf.MetaData.Keywords = "Key, Word";  // Keywords associated with the document
Pdf.MetaData.CreationDate = DateTime.Today;  // The date the document was created
Pdf.MetaData.ModifiedDate = DateTime.Now;  // The date and time the document was last modified
Pdf.MetaData.CustomProperties.Add("Test", "val");  // Custom properties for additional metadata
Pdf.MetaData.Producer = "test";  // The software used to produce the document
Pdf.MetaData.Subject = "test metadata";  // The subject of the document
Pdf.MetaData.Title = "test";  // The title of the document
Pdf.MetaData.Creator = "test";  // The original creator of the document

// Security settings for the PDF
Pdf.SecuritySettings.UserPassword = "ironuser";  // Password to open and view the PDF
Pdf.SecuritySettings.OwnerPassword = "ironowner";  // Password providing full permissions, including editing
' Assign metadata properties to a PDF document
Pdf.MetaData.Author = "John Doe" ' The author of the document
Pdf.MetaData.Keywords = "Key, Word" ' Keywords associated with the document
Pdf.MetaData.CreationDate = DateTime.Today ' The date the document was created
Pdf.MetaData.ModifiedDate = DateTime.Now ' The date and time the document was last modified
Pdf.MetaData.CustomProperties.Add("Test", "val") ' Custom properties for additional metadata
Pdf.MetaData.Producer = "test" ' The software used to produce the document
Pdf.MetaData.Subject = "test metadata" ' The subject of the document
Pdf.MetaData.Title = "test" ' The title of the document
Pdf.MetaData.Creator = "test" ' The original creator of the document

' Security settings for the PDF
Pdf.SecuritySettings.UserPassword = "ironuser" ' Password to open and view the PDF
Pdf.SecuritySettings.OwnerPassword = "ironowner" ' Password providing full permissions, including editing
$vbLabelText   $csharpLabel
  • 当仅设置了所有者密码时,用户可以完全访问PDF元数据,包括查看和修改所有文档属性的能力。
  • 当仅设置了用户密码时,只有持有密码的人才能打开PDF。 用户可以查看元数据属性,但修改元数据受到限制。

[{i:(Adobe Acrobat Pro允许用户通过提供UserPassword(如果已设置)来编辑PDF元数据。 相比之下,其他PDF查看器如Foxit要求用户提供OwnerPassword来编辑PDF元数据,此外需要UserPassword才能打开和查看PDF。)}]

Curtis Chau
技术作家

Curtis Chau 拥有卡尔顿大学的计算机科学学士学位,专注于前端开发,精通 Node.js、TypeScript、JavaScript 和 React。他热衷于打造直观且美观的用户界面,喜欢使用现代框架并创建结构良好、视觉吸引力强的手册。

除了开发之外,Curtis 对物联网 (IoT) 有浓厚的兴趣,探索将硬件和软件集成的新方法。在空闲时间,他喜欢玩游戏和构建 Discord 机器人,将他对技术的热爱与创造力相结合。

准备开始了吗?
Nuget 下载 16,154,058 | 版本: 2025.11 刚刚发布