title: How to get Tags from pdf document in c#
body: <p>I am using iTextSharp to read a pdf document and it is getting read successfully. Now I want to get Tags from a pdf document but I don't know how to get tags using iTextSharp.</p>
  
  <p>Code is given below</p>
  
  <pre><code>class Program
  {
      static void Main(string[] args)
      {
          var result = pdfText(@"C:\Users\Purelogics\Desktop\tranfer\tagged.pdf");
      }
  
      public static string pdfText(string path)
      {
          PdfReader reader = new PdfReader(path);
          //This line return true that means this document is tagged
          bool isTagged = reader.IsTagged();
          var metadeta = reader.Metadata;
          IList&lt;Dictionary&lt;string, object&gt;&gt; bookmarks = SimpleBookmark.GetBookmark(reader);
          string text = string.Empty;
          var title = reader.Info["Title"];
          for (int page = 1; page &lt;= reader.NumberOfPages; page++)
          {
              var object1 = reader.GetPdfObject(page);
              text += PdfTextExtractor.GetTextFromPage(reader, page);
          }
          reader.Close();
          return text;
      }
  }
  </code></pre>