Developer Tools
|
Office Productivity Applications
|
Platform-Agnostic APIs
|
Home | Online Demos | Downloads | Buy Now | Support | About Us | News | Working Together | Contact Us
Document properties of a PDF file include metadata such as document information, document restrictions, and font information.
This metadata, which contains precise information about the whole document, can be extracted by applications (such as file indexing services, search engine spiders, and PDF viewers and printers). Document properties can also be easily read by humans.
In previous articles, you learned about using PDFOne .NET to read and change some of these documentation properties. In this article, you will learn about how to change document information properties such as title, author, subject, and keywords.
To read the document information properties of a PDF document, you need to first load the document using an object of the PDFDocument
class and then access the PDFDocument.DocInfo
property.
// Create a new document object PDFDocument doc = new PDFDocument(); // Load an existing PDF document doc.Load("existing_doc.pdf"); // Display document information properties Console.WriteLine(doc.DocInfo.Title); Console.WriteLine(doc.DocInfo.Author); Console.WriteLine(doc.DocInfo.Subject); Console.WriteLine(doc.DocInfo.Keywords); Console.WriteLine(doc.DocInfo.Creator); Console.ReadLine(); // Press Return key to continue
The PDFDocument.DocInfo
property is an object of the PDFDocInfo
class. It allows you to set or get document information properties of the loaded PDF document. In the code snippet below, we modify the document information properties.
... // Modify document information properties doc.DocInfo.Title = "To Be Or Not To Be"; doc.DocInfo.Subject = "Hamlet's Immortal Dilemma"; doc.DocInfo.Author = "Raju Sinha"; doc.DocInfo.Keywords = "hamlet, shakespeare, dilemma, english, drama, play"; doc.DocInfo.Creator = "Gnostice PDFOne .NET component library"; // Save changes doc.OpenAfterCreate = true; doc.Save("modified_doc.pdf"); doc.Close();
---o0O0o---
Our .NET Developer Tools | |
---|---|
![]() Gnostice Document Studio .NETMulti-format document-processing component suite for .NET developers. |
![]() PDFOne .NETA .NET PDF component suite to create, edit, view, print, reorganize, encrypt, annotate, and bookmark PDF documents in .NET applications. |
Our Delphi/C++Builder developer tools | |
---|---|
![]() Gnostice Document Studio DelphiMulti-format document-processing component suite for Delphi/C++Builder developers, covering both VCL and FireMonkey platforms. |
![]() eDocEngine VCLA Delphi/C++Builder component suite for creating documents in over 20 formats and also export reports from popular Delphi reporting tools. |
![]() PDFtoolkit VCLA Delphi/C++Builder component suite to edit, enhance, view, print, merge, split, encrypt, annotate, and bookmark PDF documents. |
Our Java developer tools | |
---|---|
![]() Gnostice Document Studio JavaMulti-format document-processing component suite for Java developers. |
![]() PDFOne (for Java)A Java PDF component suite to create, edit, view, print, reorganize, encrypt, annotate, bookmark PDF documents in Java applications. |
Our Platform-Agnostic Cloud and On-Premises APIs | |
---|---|
![]() StarDocsCloud-hosted and On-Premises REST-based document-processing and document-viewing APIs |
Privacy | Legal | Feedback | Newsletter | Blog | Resellers | © 2002-2023 Gnostice Information Technologies Private Limited. All rights reserved. |