We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Document.PageColor sets the page color to black when it is set to Color.Empty using C#

Hi, Support,
I want to use aspose.words.dll to clear the background color of the whole document and the background color of paragraph, as well as unhighlight the texts in paragraphs, then set all the color to white? How to handle it?

Thanks for your demo codes.



Please use Document.PageColor property to get or set page color of the document. To remove page color, please set this property to Color.Empty.

You can use ParagraphFormat.Shading.ClearFormatting method to remove shading from the object. You can also use Shading.BackgroundPatternColor property to get or set the color that’s applied to the background of the Shading object.

To set or get highlighted color, please use Run.Font.HighlightColor property. You can set the value of color to Color.Empty to remove color of page, paragraph and text.

Thanks for your reply.

But I found the color will change to Black if using Color.Empty, therefore , I use Color.White.


We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-20068. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

The issues you have found earlier (filed as WORDSNET-20068) have been fixed in this Aspose.Words for .NET 20.4 update and this Aspose.Words for Java 20.4 update.