title: Get custom metadata for itext 7 pdf document
body: <p>I used the link given below for getting metadata in itext 5 using: <a href="https://stackoverflow.com/questions/25698460/get-and-set-metadata-for-itext-pdf-document">Get and set metadata for itext pdf document</a> </p>
  
  <p>Currently, i can get metadata in itext7 too using the snippet:</p>
  
  <pre><code>PdfDocument pdfDoc = new PdfDocument(new PdfReader(src));
  PdfDocumentInfo info = pdfDoc.getDocumentInfo();
  info.getAuthor();
  info.getCreator();
  info.getProducer();
  </code></pre>
  
  <p>I don't know how to get custom properties using the same.
  I can set custom metadata using:</p>
  
  <pre><code>pdfDoc.getDocumentInfo().setMoreInfo("Test", "test");
  </code></pre>
  
  <p>How to get this value programatically without hard coding the key name?
  Also, is there a way to get these metadata values (including custom metadata) without actually writing:</p>
  
  <pre><code>getAuthor, getCreator, etc?
  </code></pre>