Aspose.PDF is wrong when set new value for metadata


  • Windows 10 .NET 4.7
  • Aspose.PDF for NET 22.12


Aspose get a wrong result when set a new metadata value for KeyWords, steps:

  • PDF has a metadata KeyWords, its value is DDD
  • Change new value for KeyWords to 444
  • It get a wrong result, it became 444; DDD, the except result should be 444


Aspose overwrites original Creator and Producer content, and I didn’t actually change them.
Creator became to Aspose Pty Ltd. and Producer became to Aspose.PDF for.NET 22.12.0.


    var doc = new Aspose.Pdf.Document(@"C:\Users\XCL\Desktop\test\source.pdf");
    doc.Info.Title = "111";
    doc.Info.Author = "222";
    doc.Info.Subject = "333";
    doc.Info.Keywords = "444";


image.png (45.8 KB)


image.png (45.0 KB)

Test Files (112.1 KB)


We have logged this problem in our issue tracking system as PDFNET-53367. You will be notified via this forum thread once this issue is resolved. We apologize for your inconvenience.

PdfFileInfo class allows you to set file specific information of a PDF file. Please read the following article for more detail:
Set PDF File Information


This behavior is not a bug, Adobe Acrobat reads keywords not only from the DocumentInfo.Keywords, but from XMP Metadata properties as well (namely, “pdf:keywords” and “dc:subject” properties). To fully replace keywords in the document you may use PdfFileInfo and PdfXmpMetadata, for example as shown here:

using (var docInfo = new PdfFileInfo(@"source.pdf"))
    docInfo.Title = "111";
    docInfo.Author = "222";
    docInfo.Subject = "333";
    docInfo.Keywords = "444";

    // Save new DocumentInfo AND update XMP metadata with the same values

// Update additional metadata key that Adobe Reader uses as a keywords source
using (var xmp = new PdfXmpMetadata())
    xmp["dc:subject"] = keywords;