Color (103)

Hi,


I am trying to get the correct color of the text in the first cell and instead of black I get yellow. Can you please check this out?


Thanks,
Zeljko

Code:
String path = “Test.xlsx”;

Workbook workbook = new Workbook(path);
Worksheet worksheet = workbook.getWorksheets().get(0);
Cells cells = worksheet.getCells();
Cell cell = cells.get(“A1”);
Font font = cell.getDisplayStyle().getFont();
System.out.println(cell.getStringValue());
System.out.println(font.getColor());
System.out.println(Byte.toUnsignedInt(font.getColor().getR()));
System.out.println(Byte.toUnsignedInt(font.getColor().getG()));

System.out.println(Byte.toUnsignedInt(font.getColor().getB()));

Hi,

Thanks for your posting and using Aspose.Cells.

We have tested this issue with your sample code and source excel file using the latest version:
Aspose.Cells for Java v8.8.2.9
and found that it is a bug of Aspose.Cells. The color of the text in cell A1 should be black but it is yellow.

Besides, if you simply save your excel file into pdf using Aspose.Cells API, the color again appears as yellow instead of black. I have attached the output pdf for a reference.

We have logged this issue in our database for investigation. We will look into it and fix this issue. Once the issue is resolved or we have some other update for you, we will let you know asap.

This issue has been logged as

  • CELLSJAVA-41886 - Color of the text in the first cell is yellow instead of black

Hi,

We have evaluated your issue further.
Do you know who created this file? The color of the font in your machine must be yellow and window's background color is black. See the data in Theme1.xml:

Thank you.

Hi Sahi,


I am really sorry but I do not know who created the file. It was downloaded.


Cheers,
Zeljko

Hi,

Thanks for your feedback and using Aspose.Cells.

We have logged your comment in our database against this issue for product team investigation. We will look into it and fix this issue if possible. Once there is some news for you, we will update you asap.

Hi,


We have evaluated your issue further.
Well, Now we are confused how to set the color of “windowText” in your case. MS Excel automatically updates it from OS when opening the file. It means that if you changed the color of “windowText” of OS, the font color of the cell “A1” will be auto changed too in MS Excel. Though we can get color from OS too, but we cannot confirm whether there are same settings applied for the color of “windowText” between the server and terminal machines. So, we simply use the cached color value in the file, because we think the creator want to share same view to others.

Thank you.