1

Hi While working on this already written code, i am facing problem to resolve this issue. Please help me out.

In following code, itextsharp.text.table and cell does not exists issue was found, i added itexsharp dll to avoid it still it is not getting remove.

using iTextSharp.text;
using iTextSharp.text.pdf;
...

    iTextSharp.text.Table dataTable = new iTextSharp.text.Table(2);
    dataTable.DefaultHorizontalAlignment = Element.ALIGN_LEFT;
    dataTable.DefaultVerticalAlignment = Element.ALIGN_MIDDLE;
    dataTable.Border = 1;
    dataTable.AutoFillEmptyCells = false;
    dataTable.Padding = 1;
    dataTable.SpaceInsideCell = 1;
    dataTable.WidthPercentage = 100;
    dataTable.Convert2pdfptable = true;
    dataTable.TableFitsPage = true;
    //=============Adding 01 Row==================
    iTextSharp.text.Image img = iTextSharp.text.Image.GetInstance("images/LOGO4.GIF");
    iTextSharp.text.Image address = iTextSharp.text.Image.GetInstance("images/address3.GIF");
    Cell logo = new Cell(img);
    dataTable.AddCell(logo);
    Cell addres = new Cell(address);
    dataTable.AddCell(addres);
...          

Not able to resolve although i read number of related post and articles.

Markus Deibel
  • 1,261
  • 20
  • 26
  • 2
    Possible duplicate of [Type 'iTextSharp.text.Table' is not defined](https://stackoverflow.com/questions/11571922/type-itextsharp-text-table-is-not-defined) – Sinatr Oct 16 '19 at 06:55

1 Answers1

0

You are probably using an old version of a deprecated library version (Table has been replaced by PdfPTable) (iTextSharp/iText 5 has been deprecated in favor of iText 7, which has the exact same license model). In any case, you can check out documentation about tables for iTextSharp/iText 5 here and here. For iText 7, you can find similar documentation here and here (unfortunately, these are all Java examples, but the API is pretty much the same).

André Lemos
  • 837
  • 6
  • 18