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 熱衷於創建直觀且美觀的用戶界面,喜歡使用現代框架並打造結構良好、視覺吸引人的手冊。

除了開發之外,Curtis 對物聯網 (IoT) 有著濃厚的興趣,探索將硬體和軟體結合的創新方式。在閒暇時間,他喜愛遊戲並構建 Discord 機器人,結合科技與創意的樂趣。

準備好開始了嗎?
Nuget 下載 16,154,058 | 版本: 2025.11 剛剛發布