1

There are a lot of iTextSharp examples out there showing how to append metadata like "Title", "Author", "Keywords" to an existing PDF using PdfStamper.MoreInfo dictionary (like this), and I've successfully managed to do this.

But is there a way to set properties that Adobe Reader calls "Additional Metadata" that are visible when you click "Document Properties" -> "Additional metadata"? These properties include "Description", "Author title", "Copyright status", "Copyright notice" and some more. Are there some dictionary keys in PdfStamper.MoreInfo that represent these properties?

Community
  • 1
  • 1
Andre Borges
  • 1,360
  • 14
  • 37

3 Answers3

1

iText5 does not expose the additional data in PdfStamper#MoreInfo. It is however possible to retrieve the metadata containing using PdfReader#XmpMetaData and to set it using PdfDocument#XmpMetaData or PdfStamper#XmpMetaData.

the metadata is returned and set as a byte[], so you'll have to handle the translation/generation from and to yourself.

In iText7, the process is mostly the same, but handled through the PdfDocument class instead (since it is a wrapper for a PdfReader and PdfWriter object.)

Samuel Huylebroeck
  • 1,639
  • 11
  • 15
0

This is not about writing that data but how to read it. It may give you some hints on how to write it, too.

Community
  • 1
  • 1
pid
  • 11,472
  • 6
  • 34
  • 63
-1
Document doc = new Document(PageSize.A4, 36, 72, 108, 180);
doc.AddTitle("Hello World example");
doc.AddSubject("This is an Example 4 of Chapter 1 of Book 'iText in Action'");
doc.AddKeywords("Metadata, iTextSharp 5.4.4, Chapter 1, Tutorial");
doc.AddCreator("iTextSharp 5.4.4");
doc.AddAuthor("Debopam Pal");
doc.AddHeader("Nothing", "No Header");

For more details and features Click Here

nik_boyz
  • 165
  • 3
  • 15
  • Nope. (1) I asked about modifying additional metadata, while you're showing standard metadata sample (2) I asked about modifying an existing document, and your code creates a new document – Andre Borges Sep 15 '16 at 08:28