title: Image overwrites table cell border in iTextSharp
body: <p>I am trying to create a PDF using iTextSharp library (version 4.1.2.0). At the top of the document, I want to add a logo, horizontal line and - below the line - some text (title).</p>
  
  <p>I'm trying to achieve this by:</p>
  
  <ol>
  <li>creating a PdfPTable with one column size</li>
  <li>adding to it a PdfPCell with border set to BOTTOM_BORDER containing the logo image</li>
  <li>adding another PdfPCell with the title text to the PdfPTable</li>
  </ol>
  
  <p>However, in the resulting PDF the image overwrites the bottom border (which otherwise shows fine). How can I stop it from overwriting it? The only way I've been able to do it is by setting FIT parameter of the PdfPCell constructor to true, but this completely destroys the layout (the image is enormous).</p>
  
  <p>The code:</p>
  
  <pre><code>        document.Open();
  
          Image img = Image.GetInstance("Logo.PNG");
          PdfPCell cell = new PdfPCell(img, false);
          PdfPTable table = new PdfPTable(1);
          cell.Border = PdfPCell.BOTTOM_BORDER;
          table.DefaultCell.Border = PdfPCell.NO_BORDER;
          table.WidthPercentage = 100;
          table.AddCell(cell);
  
          PdfPCell cell2 = new PdfPCell(new Phrase("Title"));
          cell2.Border = PdfPCell.TOP_BORDER;
          table.AddCell(cell2);
          document.Add(table);
  
          document.Close();
  </code></pre>
  
  <p>And this is how it looks like:</p>
  
  <p><a href="http://img137.imageshack.us/img137/9574/outputhc.png" rel="nofollow">This is how it looks like</a></p>