PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sun Apr 28, 2024 7:31 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Mon Mar 22, 2010 7:59 pm 
Offline

Joined: Mon Mar 22, 2010 7:42 pm
Posts: 1
Hi,

I use MigraDoc an want to style a TableRow using styles. The problem is, that i can't set neither the background-color (Shading) nor the foreground-color (Font.Color).

The following code works well:
Row oRowHeader = oTable.
oRowHeader.Style = oStyle.Name;
oRowHeader.Shading.Color = new Color(0, 0, 139);
oRowHeader.Format.Font.Color = new Color(255, 255, 255);

but this code doesn't work (the foreground is white, but the background not blue for the entire row):
Style oStyle = oDocument.Styles.AddStyle("RowHeader", StyleNames.Normal);
oStyle.Font.Color = new Color(255, 255, 255);
oStyle.ParagraphFormat.Shading.Color = new Color(255, 255, 255); // not the same as above... and the style has no shading-property
Row oRowHeader = oTable.AddRow();
oRowHeader.Style = "RowHeader";


Top
 Profile  
Reply with quote  
PostPosted: Tue Mar 23, 2010 8:47 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3096
Location: Cologne, Germany
lurchi wrote:
The problem is, that i can't set neither the background-color (Shading) nor the foreground-color (Font.Color).


You can set the background colour for the row (row.Shading).
Instead you set the paragraph background colour for the text in the row (which does not cover the complete row).

There are some typos in your code snippets.

_________________
Regards
Thomas Hoevel
PDFsharp Team


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

All times are UTC


Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 363 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