PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sun Jun 30, 2024 2:04 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: Thu Jun 11, 2015 10:27 am 
Offline

Joined: Thu Jun 11, 2015 10:19 am
Posts: 4
Hi. I have a table in Migradoc and I am making a cell span two rows and putting text into it, then setting a background shading. However, the shading only covers the text whereas I want it to fill the whole (double-height) cell.

Code:
cell.MergeDown=1;
Paragraph paragraph = cell.AddParagraph();
cell.Format.Shading.Color = new Color(0, 176, 80);
paragraph.AddFormattedText("Hello world");


The output is attached (I've had to redact the text). The green box on the right should be the same height as the one on the left.


Attachments:
migradoc_problem.png
migradoc_problem.png [ 2.27 KiB | Viewed 5645 times ]
Top
 Profile  
Reply with quote  
PostPosted: Thu Jun 11, 2015 11:00 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3100
Location: Cologne, Germany
Hi!

A search for "cell shading" found the answer here:
viewtopic.php?p=8053#p8053

You need (without ".Format"):
Code:
cell.Shading.Color = new Color(0, 176, 80);

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Thu Jun 11, 2015 11:43 am 
Offline

Joined: Thu Jun 11, 2015 10:19 am
Posts: 4
Thomas Hoevel wrote:
Hi!

A search for "cell shading" found the answer here:
viewtopic.php?p=8053#p8053

You need (without ".Format"):
Code:
cell.Shading.Color = new Color(0, 176, 80);

Thanks Thomas, that is the answer :D.


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: No registered users and 24 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