From e42dfba731db06093fe296146f446a41761bfa75 Mon Sep 17 00:00:00 2001 From: Ariel Rorabaugh Date: Wed, 17 Apr 2024 08:53:41 -0400 Subject: [PATCH] Fix background color in Word export - Specify background color using the fill property instead of color property of a shading object. Change-Id: I33127e08dcb11551d001a96bb658f7abe1c4c780 --- Src/xWorks/WordStylesGenerator.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Src/xWorks/WordStylesGenerator.cs b/Src/xWorks/WordStylesGenerator.cs index 9c389f9242..5db6db276c 100644 --- a/Src/xWorks/WordStylesGenerator.cs +++ b/Src/xWorks/WordStylesGenerator.cs @@ -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); }