How do I access other metadata fields in PDF?

Q: The PDFDocInfo class seems to only provide access to a limited
number of metadata attributes. Do you have an example/API for
accessing other attributes? For example, the DICOM Study Description
A: PDFDocInfo provides access to all standard PDF metadata attributes.
I suspect that ‘DICOM Study Description’ attribute is most likely
stored as a custom attribute and you can use low-level API to extract
these values. For this you would need to know how and where these
values are stored. For example, the following code is using SDF/Cos
API to perform similar operation to what you would do using

PDFDoc doc = new PDFDoc(...);
Obj trailer = doc.GetTrailer(); // Get the trailer
Obj info = trailer.FindObj("Info");
if (info != null) {
  // Get 'Title'/'Author'/'Keywords'/'Subject'...
  // entry, if available
  Obj title_obj = info.FindObj("Title");
  if (title_obj != null)
  { // Note: In some documents these strings are encoded
    // using PDF text encoding.
    String title = title_obj.GetString();
    title_obj.SetString("My Title...");
  else {
    info.PutString("Title", "My Title...");