Hi Thomas,
Hi Thomas,
string outFile = “33759.pdf”;<o:p></o:p>
Document doc = new Document();
Page page = doc.Pages.Add();
Aspose.Pdf.Table attributetable = new Aspose.Pdf.Table();
attributetable.RepeatingRowsCount = 1;
attributetable.Border = new Aspose.Pdf.BorderInfo(Aspose.Pdf.BorderSide.All, 0.1F);
attributetable.DefaultCellBorder = new Aspose.Pdf.BorderInfo(Aspose.Pdf.BorderSide.All, 0.1F);
TextState textFormat2 = new TextState();
textFormat2.Font = FontRepository.FindFont("Trebuchet MS");
textFormat2.FontSize = 11;
attributetable.DefaultCellTextState = textFormat2;
attributetable.DefaultCellPadding = new Aspose.Pdf.MarginInfo();
attributetable.DefaultCellPadding.Top = 3;
attributetable.DefaultCellPadding.Bottom = 3;
attributetable.DefaultCellPadding.Left = 3;
attributetable.DefaultCellPadding.Right = 3;
Aspose.Pdf.Row headerrow = attributetable.Rows.Add();
headerrow.BackgroundColor = Aspose.Pdf.Color.FromArgb(210, 210, 210);
TextState textformatheader = new TextState();
textformatheader.Font = FontRepository.FindFont("Trebuchet MS");
textformatheader.FontSize = 12;
textformatheader.FontStyle = FontStyles.Bold;
headerrow.DefaultCellTextState = textformatheader;
Aspose.Pdf.Cell numbercell = headerrow.Cells.Add("No.");
List<string> descriptionstrings = new List<string>();
descriptionstrings.Add("Coll1");
descriptionstrings.Add("Coll2");
foreach (string headerstr in descriptionstrings)
headerrow.Cells.Add(headerstr);
int rowvar = 0;
for (int i = 0; i < 2; i++)
{
Aspose.Pdf.Row row1 = attributetable.Rows.Add();
if (rowvar%2 != 0) row1.BackgroundColor = Aspose.Pdf.Color.FromArgb(235, 0, 0);
rowvar++;
row1.Cells.Add(rowvar.ToString());
row1.Cells.Add("Value Coll1");
//see Result in PureTabelrowBreak.pdf
HtmlFragment desc = new HtmlFragment( "
+ "
+ "
Aspose.Pdf.Cell rowCell = row1.Cells.Add();
rowCell.Paragraphs.Add(desc);
}
attributetable.ColumnAdjustment = ColumnAdjustment.AutoFitToContent;
page.Paragraphs.Add(attributetable);
// Save the resultant PDF document
doc.Save(outFile);
The issues you have found earlier (filed as PDFNEWNET-33759) have been fixed in Aspose.Pdf for .NET 10.6.0.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.