How do I modify the description information from a PDF?

30 views
Skip to first unread message

Shakthi Wijeratne

unread,
Mar 3, 2021, 3:55:49 PM3/3/21
to PDFTron SDK
Q: I would like to modify/remove the description information (metadata) from a PDF document.

A: Most of the time, this information is stored in the optional Info dictionary in the trailer. You can either modify it using our DocInfo API like so:

PDFDoc doc = new PDFDoc(@"test.pdf");
var docinfo = doc.GetDocInfo();

Please see the API for the available methods:

If you would like to remove this information, you can just erase the whole dictionary with our API like so:

PDFDoc doc = new PDFDoc(@"test.pdf");
doc.GetTrailer().Erase("Info");

It is also likely you will need to remove the XMP information, as it also can contain some metadata like so:
doc.GetRoot().Erase("Metadata");

Reply all
Reply to author
Forward
0 new messages