PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Fri Jul 05, 2024 6:27 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Wed May 08, 2013 2:36 pm 
Offline

Joined: Wed May 08, 2013 10:56 am
Posts: 17
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.


Top
 Profile  
Reply with quote  
PostPosted: Wed May 08, 2013 3:21 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3101
Location: Cologne, Germany
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).

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Wed May 08, 2013 3:25 pm 
Offline

Joined: Wed May 08, 2013 10:56 am
Posts: 17
That worked, thanks.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 73 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group