Aspose.PDF .NET 10.4
Hi Dirk,
Here’s a full example. I should have 2 lines in the cell. One as a title. And the second with 2 different colors and sizes in the same line.
string exportPath = Path.Combine(“c:\temp”, “TableStylesTest.pdf”);
Document doc = new Document();
Page page = doc.Pages.Add();
page.PageInfo.Margin = new MarginInfo(10, 10, 10, 10);Table table = new Table();
table.ColumnWidths = page.PageInfo.Width.ToString();
Row row = table.Rows.Add();
Cell cell = row.Cells.Add();cell.Alignment = HorizontalAlignment.Left;
cell.VerticalAlignment = VerticalAlignment.Bottom;
cell.Margin = new MarginInfo(11, 11, 11, 0);
cell.IsWordWrapped = true;var title = new TextFragment(“Title on it’s own line”);
title.TextState.FontStyle = FontStyles.Bold;
title.TextState.FontSize = 14;
title.TextState.ForegroundColor = Color.Black;
title.Margin = new MarginInfo(0, 4, 0, 0);
title.IsInLineParagraph = false;cell.Paragraphs.Add(title);
TextSegment name = new TextSegment("hopefully a new line here and blue ");
name.TextState.FontSize = 13f;
name.TextState.ForegroundColor = Color.Blue;TextSegment rm = new TextSegment(“should continue line in green, smaller font”);
rm.TextState.FontSize = 10f;
rm.TextState.ForegroundColor = Color.Green;TextFragment list = new TextFragment();
list.IsInLineParagraph = false;
title.Segments.Add(name);
title.Segments.Add(rm);cell.Paragraphs.Add(list);
page.Paragraphs.Add(table);
doc.Save(exportPath);
return exportPath;
Hi Dirk,
I
have tested the scenario and I am able to reproduce the same problem. For the
sake of correction, I have logged it in our issue tracking system as PDFNEWNET-38776. We
will investigate this issue in details and will keep you updated on the status
of a correction. <o:p></o:p>
We apologize for your inconvenience.
The issues you have found earlier (filed as PDFNET-38776) have been fixed in Aspose.PDF for .NET 18.12.