Can I change font size of Style without recreating whole document.
I want to put this in cycle
to fit table on a page
by decreasing table font size.
But it seems it doesn't work this way.
Code:
Document document;
// Create a new PDF document
document = CreateDocument();
// Create a renderer and prepare (=layout) the document
MigraDoc.Rendering.DocumentRenderer docRenderer = new DocumentRenderer(document);
docRenderer.PrepareDocument();
pageCount = docRenderer.FormattedDocument.PageCount;
while (pageCount > 1)
{
ScheduleFontsize -= 1;
document.Styles["ScheduleBody"].Font.Size = ScheduleFontsize;
// Create a renderer and prepare (=layout) the document
docRenderer = new DocumentRenderer(document);
docRenderer.PrepareDocument();
pageCount = docRenderer.FormattedDocument.PageCount;
}
Somewhere in CreateDocument();
...
row2.Cells[1].Style = "ScheduleBody";
...