0

I need to crate a PDF with following structure!

http://www.freeimagehosting.net/6auu8 (link of my image)

my snippet was...

//Create new Pdfptable

PdfPTable table = new PdfPTable(4);

// create new cell

PdfPCell LEFT= new PdfPCell(new Phrase("Left"));

LEFT.Colspan = 1;

LEFT.Rowspan = 2;

table.AddCell(LEFT);


// create another cell

PdfPCell RIGHT= new PdfPCell(new Phrase("Right"));

RIGHT.Colspan = 3;

RIGHT.Rowspan = 2;

table.AddCell(RIGHT);

but, it not working.....

Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
user1146956
  • 91
  • 1
  • 3
  • 4

1 Answers1

0

Try this:

Document document = new Document();
            PdfWriter.GetInstance(document, new FileStream("c:\\Chap0501.pdf", FileMode.Create));
            PdfPTable table = new PdfPTable(4);
            document.Open();
            PdfPCell LEFT = new PdfPCell(new Phrase("Left"));
            LEFT.Colspan = 1;
            LEFT.Rowspan = 2;
            table.AddCell(LEFT);
            PdfPCell RIGHT = new PdfPCell(new Phrase("Right"));
            RIGHT.Colspan = 3;
            RIGHT.Rowspan = 2;
            table.AddCell(RIGHT);
            document.Add(table);
            document.Close();
Vinod
  • 4,672
  • 4
  • 19
  • 26