title: How to check metadata exist or not before reading by iTextsharp
body: <p>my application will need to read the metadata (e.g. author, keywords, etc.) of the pdf file.</p>
  
  <p>my function is as follows:</p>
  
  <pre><code>Public Sub ReadPDF(PdfFileName As String)
  
  Dim reader As PdfReader = New PdfReader(PdfFileName)
  
  pdf_keyword = ""
  
  'Read PDF metadata
  pdf_keyword = reader.Info("Keywords")
  
  End Sub
  </code></pre>
  
  <p>the above works fine to get keyword. but it will returns error "The given key was not present in the dictionary." if there is no metadata "keywords" exist in the pdf. So how can i check is there any "keywords" metadata exist before reading ?</p>
  
  <p>Thansk</p>