Background color seeping through an image

Hello,

I am generating a word document and inserting an image into a table. The underlying color is green but more cells are being added with a background color of white (hopefully). Unfortunately where the image is the background color is green rather than white, even though I am explicitly setting the color.

Any help would be appreciated on how I can get the color to be white. I have attached a copy of the document (color.zip). See point 4 in the doc where the “i” image is. The background color is green, it should be white.

Thanks

Hi David,

Thanks for your request. In case you are building your document using DocumentBuilder, please try applying font shading before inserting the image e.g:

DocumentBuilder builder = new DocumentBuilder(doc);
Shading shd = builder.Font.Shading;
shd.BackgroundPatternColor = Color.White;
builder.InsertImage("image path");

For more details, please see the following link:
https://reference.aspose.com/words/net/aspose.words/font/shading/

Please let us know if you need more information, We are always glad to help you.

Best Regards,