Issues with solid background color in cells

I’m having some issues when saving an Excel sheet as PDF when filling
a group of cells with a solid color. The resulting PDF looks fine in e.g.
Adobe PDF reader but the cells have visible borders between them when
viewed in PDF.JS (PDF reader in Mozilla Firefox). However, if I save the
same Excel file as PDF via Microsoft Excel then the PDF looks fine within
PDF.JS. Is this a bug or is there a setting to fix this issue?

I’ve attached an example file and a rendered version from both Aspose
and Excel. Aspose_background_color_issue.zip (169.6 KB)

@patjep,
We have reproduce the issue here and logged it in our database for further investigation. You will be notified here once any update is ready for sharing.

This issue is logged as:
CELLSCPP-278 - Borders become visible while converting Excel to PDF

@patjep,

For this situation, when filling a group of cells with a solid color, Aspose.Cells will convert each cell accordingly. In this case, the adjacent cell will have the same coordinates (The adjacent line or column). But, the different PDF program may have different rendering results. Actually, Aspose.Cells converts XLSX files to PDF a bit differently here from saving XLSX files to PDF by MS Excel in details. So, this is not a bug in the APIs and Aspose.Cells always treats it as accordingly.

Thanks for your understanding!

@Amjad_Sahi ,

Okay, I get that you calculate the results somewhat differently than Microsoft Excel does. However, I am very interested in knowing what you base your conclusion on. Is it to be expected that features like the PDF renderer doesn’t behave like their counterpart in Microsoft Excel?

@patjep,

Yes, for your case, the behavior of Aspose.Cells renderer is a bit different than MS Excel’s behavior. We have recorded your concerns and will evaluate it soon. We will get back to you with further updates soon.

@patjep,

Aspose.Cells and Microsoft Excel exhibit different implementations of PDF generation which follow PDF Reference. They look same in Adobe PDF Reader in most cases. However, for other PDF Reader, there can be a few differences in some cases. For the attached file, please convert it to PDF by MS Excel and then open it in FireFox, you can see the differences compared to generated by Aspose.Cells.
Solid_to_PDF.zip (5.8 KB)

@Amjad_Sahi ,

I am aware of the fact that there are differences; that’s the problem. My customers expect to be able to
use their PDF reader of choice to view the PDFs generated by my application (and thus indirectly by Aspose.Cells). Sadly, many of my customers work with Firefox as their main PDF reader and therefore I need to make it work somehow.

Minor differences might be okay, but having a couple of cells filled to create a background effect is a very common way to achieive a nice layout effect in an Excel file. The fact that this particular feature doesn’t work properly in Aspose.Cells is an issue.

@patjep,

Thanks for sharing your concerns.

We will evaluate it further and get back to you soon.

@patjep,
Maybe the details were not clear last time, for the file “Solid to PDF.xlsx” attached, after converting to pdf, please watch the result in “compare(Firefox show).png”. In this picture, the right is generated by Aspose.Cells and the left is got by MS Excel, we can see that the left also have white border, which is different as compared to preview in Adobe, please check.

If you handle the generation of the source xlsx file, as a workaround, you can add inside border with same color for the cells, Then the visible white line will disappear in Firefox. Please see the attached figure “set border.png”.

set border.png (9.4 KB)
compare(Firefox show).png (523 Bytes)
Solid to PDF.zip (5.8 KB)

Let us know your feedback.

@ahsaniqbalsidiqui ,

Okay, a workaround is good to have, though our customers generate the Excel (xlsx) file on their own. Our support team will surely be able to give the customers a workaround, but its more important that we can get a real fix for this issue. Can we expect a fix in Aspose.Cells for this particular issue sometime soon?

@patjep,

Please devise the workaround as suggested.

We already told that this might not be a bug on Aspose.Cells end. Anyways, we will further evaluate and get back to you soon.

@patjep,

It is difficult for us to keep the same rendering results for the PDF files converted by Aspose.Cells in each PDF reader. Same is the case when similar PDF files generated by MS Excel show differences in different PDF readers. Since sometime this difference is caused by the PDF reader, so we might not fix this issue anytime soon. But if we are able to solve this problem in future, we will let you know.

Sorry for any inconvenience caused!