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

Free Support Forum - aspose.com

Convert DOCX to PDF & Retain Coloring Positioning etc of Axis Data, Legend Labels in Chart using C# .NET

Hi,

When converting a DOCX with a chart to PDF. I noticed many labels are wrong in the PDF, including axis, data and legend labels.

Code:

var doc = new Document(@".\test2.docx");
doc.Save(@".\test2.pdf");

I’ve attached the test files and a screenshot for your reference. Could you please help to take a look?

test2.zip (5.1 MB)
image.png (40.8 KB)

Thanks,

@ServerSide527,

We tested the scenario and have managed to reproduce the same problem on our end. For the sake of correction, we have logged this problem in our issue tracking system. The ID of this issue is WORDSNET-19469. We will further look into the details of this problem and will keep you updated on the status of correction. We apologize for your inconvenience.

@ServerSide527,

During investigation we have found that there are actually following three issues:

  • Incorrect position of the series data labels. We have integrated the fix of this issue in Aspose.Words for .NET 20.2 release. So, please upgrade to the latest version for this fix.
  • Colors settings for series and axis data labels are not taking into account. We have implemented a fix and currently we are reviewing the changes made in the scope of WORDSNET-19469.
  • Incorrect size of the legend marker. We have logged a separate issue WORDSNET-19989 to address this problem. Your thread has been linked to this new issue and you will be notified as soon as the linked issues will be resolved in future.

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

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

Hi,

I have tested with Aspose.Words 20.3.0 and noticed the behaviour is significantly better than before. Thanks very much.

However, I noticed some discrepancies on the unit alignment, I’ve attached a screenshot for your reference:
image.png (90.5 KB)

I’m using the same test files in my initial comment.

Could this be addressed?

Thanks,

@ServerSide527,

You are right. To address this problem, we have logged another issue in our issue tracking system with ID WORDSNET-20135.

We apologize for your inconvenience.

@ServerSide527,

During further investigation on WORDSNET-20135, we have found that there are actually two problems:

  • The position of the axis title is not defined correctly. (WORDSNET-20135)
  • The problem with calculating the width of the plot area when manual layout is set and the chart is composite.

To address this second problem, we have logged another issue with ID WORDSNET-22300. It seems that MS Word uses the additional offsets from the title text (1.5 points left and right and 0.75 points top and bottom). We are investigating these problems further and will notify you here when these will get resolved in future.

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

Hi,

Thanks for the updates.

Regarding the issue mentioned in the above comment (Convert DOCX to PDF & Retain Coloring Positioning etc of Axis Data, Legend Labels in Chart using C# .NET), it seems the alignment has now been improved but it is still not exactly the same as the original.

Please find the screenshot below which is a comparison between Word docx vs Aspose 20.3.0 vs Aspose 21.9.0:

image.png (120.7 KB)

The ticket WORDSNET-20135 was about ‘The position of the axis title is not defined correctly.’ so it seemed the issue was not fully fixed as the position of the title is still a bit misaligned. Could the remaining discrepancy be fixed as well? Or will it be included as part of the pending ticket WORDSNET-22300?

Thanks,

@ServerSide527,

You’re right, 21.9 version of Aspose.Words for .NET does not fix this particular issue. We have logged these details in our issue tracking system and will keep you posted here on further updates.

@ServerSide527,

Yes, this issue will be addressed by WORDSNET-22300. We will inform you via this thread as soon as a version containing the fix of WORDSNET-22300 will be released in future.