Hi Ahmad,
Hy Nayyer
Hi Ahmad,
Document doc = new
Document();<o:p></o:p>
doc.Pages.Add();
doc.Pages[1].PageInfo.IsLandscape = true;
// Pdf pdfReport = new Pdf();
// pdfReport.IsLandscape = true;
// pdfReport.IsTruetypeFontMapCached = true;
//pdfReport.TruetypeFontMapStream = fontMap;
doc.PageInfo.Height = Aspose.Pdf.PageSize.A4.Height;
doc.PageInfo.Width= Aspose.Pdf.PageSize.A4.Width;
//set ukuran pdf
// pdfReport.PageSetup.PageHeight = Aspose.Pdf.Generator.PageSize.A4Height;
// pdfReport.PageSetup.PageWidth = Aspose.Pdf.Generator.PageSize.A4Width;
doc.PageInfo.Margin.Left = 25;
doc.PageInfo.Margin.Right = 25;
//set margin
// pdfReport.PageSetup.Margin.Left = 25;
// pdfReport.PageSetup.Margin.Right = 10;
//Create the section in the Pdf object
// Section sec1 = pdfReport.Sections.Add();
//set title
Aspose.Pdf.Table tabTitle = new Aspose.Pdf.Table();
doc.Pages[1].Paragraphs.Add(tabTitle);
// sec1.Paragraphs.Add(tabTitle);
tabTitle.ColumnWidths = "790";
// tabTitle. PositioningType = PositioningType.ColumnRelative;
Aspose.Pdf.Row rowTitle = tabTitle.Rows.Add();
//rowTitle.DefaultCellTextState.HorizontalAlignment = Aspose.Pdf.HorizontalAlignment.Center;
//rowTitle.DefaultCellTextState.FontSize = 20;
// rowTitle.DefaultCe .VerticalAlignment = Aspose.Pdf.Generator.VerticalAlignmentType.Center;
rowTitle.Cells.Add("LAPORAN PERJANJIAN");
//end of set title
//set date
Aspose.Pdf.Table tabDate = new Aspose.Pdf.Table();
tabDate.Margin.Top = 50;
doc.Pages[1].Paragraphs.Add(tabDate);
//sec1.Paragraphs.Add(tabDate);
tabDate.ColumnWidths = "790";
// tabDate.PositioningType = PositioningType.ColumnRelative;
Aspose.Pdf.Row rowDate = tabDate.Rows.Add();
// rowDate.DefaultCellTextState.HorizontalAlignment = Aspose.Pdf.HorizontalAlignment.Right;
// rowDate.DefaultCellTextState.FontSize= 15;
// rowDate.VerticalAlignment = Aspose.Pdf.Generator.VerticalAlignmentType.Center;
rowDate.Cells.Add(""+DateTime.Now);
//end of set date
//Instantiate a table object
Aspose.Pdf.Table tab1 = new Aspose.Pdf.Table();
//margin table
tab1.Margin.Top = 100;
//Add the table in paragraphs collection of the desired section
//sec1.Paragraphs.Add(tab1);
doc.Pages[1].Paragraphs.Add(tab1);
//Set with column widths of the table
tab1.ColumnWidths = "100 100 70 100 100 70 70 100 80";
//tab1 .PositioningType = PositioningType.ColumnRelative;
//Set default cell border using BorderInfo object
tab1.DefaultCellBorder = new Aspose.Pdf.BorderInfo( Aspose.Pdf.BorderSide.All, 1F);
//Set table border using another customized BorderInfo object
tab1.Border = new Aspose.Pdf.BorderInfo(Aspose.Pdf.BorderSide.All, 1F);
//ini baris judul
Aspose.Pdf.Row row1 = tab1.Rows.Add();
row1.BackgroundColor = Aspose.Pdf.Color.Beige; //("#F538FF");
// row1.DefaultCellTextState.HorizontalAlignment = Aspose.Pdf.HorizontalAlignment.Center;
// row1.VerticalAlignment = Aspose.Pdf.Generator.VerticalAlignmentType.Center;
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.DefaultCellTextState.HorizontalAlignment = Aspose.Pdf.HorizontalAlignment.Center;
// rowTable.VerticalAlignment = Aspose.Pdf.Generator.VerticalAlignmentType.Center;
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”);