Attached sample has default font size “10”. I use “DocumentBuilder.PushFont/PopFont” and write text with font size 14. Then a table is written. After the “EndTable” call, the documentbuilder font size has changed to “14” (the size before “PopFont”).
DocumentBuilder docBuilder = new DocumentBuilder(doc);
docBuilder.Document.Styles.DefaultParagraphFormat.Style.Font.Size = 10;
docBuilder.PushFont();
docBuilder.Font.Size = 14;
docBuilder.Font.Bold = true;
docBuilder.Writeln("This is the title");
docBuilder.PopFont();
docBuilder.StartTable();
//add cells...
docBuilder.EndRow();
//add more cells...
docBuilder.EndTable();
//After "EndTable", the font will be set to the font which was used before "PopFont"...
docBuilder.Writeln("TESTTESTTEST");
AsposeTableTest.zip (4.9 MB)
I found https://forum.aspose.com/t/documentbuilder-endtable-sets-documentbuilder-properties-unexpectedly-font-paragraphformat-etc/194788/5 which sounds similar, but this post does not mention “PushFont”, so I created a new topic.
Is this a bug?
Best regards
Wolfgang