Skip to content

Commit

Permalink
Fix background color in Word export (#26)
Browse files Browse the repository at this point in the history
- Specify background color using the fill property
instead of color property of a shading object.
  • Loading branch information
aror92 authored Apr 17, 2024
1 parent 6610f05 commit 9c84e0c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Src/xWorks/WordStylesGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -617,9 +617,10 @@ private static StyleRunProperties AddFontInfoWordStyles(BaseStyleInfo projectSty
System.Drawing.Color backColor;
if (GetFontValue(wsFontInfo.m_backColor, defaultFontInfo.BackColor, out backColor))
{
// note: open xml does not allow alpha
// note: open xml does not allow alpha,
// though a percentage shading could be implemented using shading pattern options.
string openXmlColor = GetOpenXmlColor(backColor.R, backColor.G, backColor.B);
var backShade = new Shading() { Color = openXmlColor };
var backShade = new Shading() { Fill = openXmlColor };
charDefaults.Append(backShade);
}

Expand Down

0 comments on commit 9c84e0c

Please sign in to comment.