Hi Ahmad,
Hy Nayyer
Hi Ahmad,
Thanks for sharing the details.
I have tested the scenario and have observed the same issue. However, for the sake of correction, I would suggest you to please try using the Aspose.Pdf namespace. Please take a look at the following code snippet. You may correct the formatting of the table as per your requirements.
[C#]
Document doc = new Document();
doc.Pages.Add();
doc.Pages[1].PageInfo.IsLandscape = true;
doc.PageInfo.Height = Aspose.Pdf.PageSize.A4.Height;
doc.PageInfo.Width = Aspose.Pdf.PageSize.A4.Width;
doc.PageInfo.Margin.Left = 25;
doc.PageInfo.Margin.Right = 25;
// Create the section in the Pdf object
Aspose.Pdf.Table tabTitle = new Aspose.Pdf.Table();
doc.Pages[1].Paragraphs.Add(tabTitle);
tabTitle.ColumnWidths = "790";
Aspose.Pdf.Row rowTitle = tabTitle.Rows.Add();
rowTitle.Cells.Add("LAPORAN PERJANJIAN");
// Set date
Aspose.Pdf.Table tabDate = new Aspose.Pdf.Table();
tabDate.Margin.Top = 50;
doc.Pages[1].Paragraphs.Add(tabDate);
tabDate.ColumnWidths = "790";
Aspose.Pdf.Row rowDate = tabDate.Rows.Add();
rowDate.Cells.Add("" + DateTime.Now);
// Instantiate a table object
Aspose.Pdf.Table tab1 = new Aspose.Pdf.Table();
tab1.Margin.Top = 100;
doc.Pages[1].Paragraphs.Add(tab1);
tab1.ColumnWidths = "100 100 70 100 100 70 70 100 80";
tab1.DefaultCellBorder = new Aspose.Pdf.BorderInfo(Aspose.Pdf.BorderSide.All, 1F);
tab1.Border = new Aspose.Pdf.BorderInfo(Aspose.Pdf.BorderSide.All, 1F);
// First row
Aspose.Pdf.Row row1 = tab1.Rows.Add();
row1.BackgroundColor = Aspose.Pdf.Color.Beige;
row1.Cells.Add("Nomor Perjanjian");
row1.Cells.Add("Judul Perjanjian");
row1.Cells.Add("Jenis");
row1.Cells.Add("Tanggal Perjanjian");
row1.Cells.Add("Tanggal Penyampaian");
row1.Cells.Add("Pihak Ketiga");
row1.Cells.Add("Harga");
row1.Cells.Add("Jangka Waktu");
row1.Cells.Add("Keterangan");
string jenis;
string tanggalPenyampaianPerjanjian = " - ";
string tanggalPerjanjian = "";
string pihakKetiga = " - ";
string harga = " - ";
string jangkaWaktu = " - ";
string keterangan = "";
for (int i = 0; i < 100; i++)
{
Aspose.Pdf.Row rowTable = tab1.Rows.Add();
rowTable.Cells.Add("content 1");
rowTable.Cells.Add("content 2");
rowTable.Cells.Add("content 3");
rowTable.Cells.Add("content 4");
rowTable.Cells.Add("content 5");
rowTable.Cells.Add("content 6");
rowTable.Cells.Add("content 7");
rowTable.Cells.Add("content 8");
rowTable.Cells.Add("content 9");
}
doc.Save("c:/pdftest/LargeTable_Test.pdf");