I am new to generating the invoice using ItextSharp in C# . How can I generate he PDF with the following layout attached herewith
Customer Code - Test Customer Name - Test Customr Invoice No - 122 Invoice Date - 12/04/2016
I am new to generating the invoice using ItextSharp in C# . How can I generate he PDF with the following layout attached herewith
Customer Code - Test Customer Name - Test Customr Invoice No - 122 Invoice Date - 12/04/2016
Please read the official documentation and you'll find the answer to questions such as:
There are also more general chapters, for instance the Q&A about tables. I'm mentioning this part of the site, because it looks as if you're trying to create a PdfPTable
:
Try creating a table like this:
public static PdfPTable CreateFirstTable() {
// a table with three columns
PdfPTable table = new PdfPTable(3);
// the cell object
PdfPCell cell;
// we add a cell with colspan 3
cell = new PdfPCell(new Phrase("Cell with colspan 3"));
cell.Colspan = 3;
table.AddCell(cell);
// now we add a cell with rowspan 2
cell = new PdfPCell(new Phrase("Cell with rowspan 2"));
cell.Rowspan = 2;
table.AddCell(cell);
// we add the four remaining cells with addCell()
table.AddCell("row 1; cell 1");
table.AddCell("row 1; cell 2");
table.AddCell("row 2; cell 1");
table.AddCell("row 2; cell 2");
return table;
}
Now add this table to a Document
:
document.add(CreateFirstTable());
This simple table should give you an idea on how the principle works. You need a table with two columns to which you can add as many cells with customer codes and invoices as you want.