PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

Styles not applied to Footer content
https://forum.pdfsharp.net/viewtopic.php?f=2&t=2431
Page 1 of 1

Author:  benfosterdev [ Wed May 08, 2013 2:36 pm ]
Post subject:  Styles not applied to Footer content

I've set up a style called Footer like so:

Code:
            var footer = doc.AddStyle("Footer", "Normal");
            footer.Font.Size = Unit.FromPoint(9);
            footer.Font.Color = new Color(109, 179, 63);


And am applying it as below:

Code:
            var footer = section.Footers.Primary.AddParagraph();
            footer.Style = "Footer";
            footer.AddText("Test");


But the styles are not applied to the generated PDF.

Author:  Thomas Hoevel [ Wed May 08, 2013 3:21 pm ]
Post subject:  Re: Styles not applied to Footer content

Hi!

Looks like a bug in MigraDoc.

The style Footer is created by default.
To modify it, just use
Code:
doc.Styles[StyleNames.Footer];
instead of
Code:
doc.AddStyle("Footer", "Normal");
and it will work.

Your code should work also (but there is a minor bug in the current implementation).

Author:  benfosterdev [ Wed May 08, 2013 3:25 pm ]
Post subject:  Re: Styles not applied to Footer content

That worked, thanks.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/