Issues with Y axis and date formats in a graph

Hi,

We’re trying to convert a Word file to PDF using Aspose.Words 21.8.
We’ve been experiencing two issues with one of the graphs in the file:

  1. The values in the Y axis are changed. In the Word file, the maximum value is 6, but in the PDF, it’s 50.
  2. The date format in the X axis is changed. In the Word file it’s dd/mm/yyyy, and in the PDF it’s mm/dd/yyyy.

Please let me know what’s causing this.

A file containing the affected graph is attached.
Diffrences.docx (15.9 KB)

I’ve also tried converting it using the free online converter, and the two issues happened there as well.

Thanks,
Amit

@operationsdotbcs Thank you for reporting this issues. to us.

  1. I have managed to reproduce the problem with Y axis scaling. It is logged as WORDSNET-23154. We will let you know once it is resolved.
  2. I cannot reproduce the problem with date format on my side. In both MS Word and in output PDF documents produced by Aspose.Words and MS Word date format is mm/dd/yyyy.

Hi Alexey,

Thank you for your response.

Regarding point number 2 - we’ve been able to reproduce this issue using the free online converter.
Can you please try to reproduce it again? Keep in mind that in the original file, the format was dd/mm/yyyy - maybe your local machine needs to use this same format for you to be able to reproduce this, I’m not sure.

You can also see details of how this was reproduced in the attached file.

Please keep me updated.

Amit
Doc1.docx (135.7 KB)

@operationsdotbcs Thank you for additional information. Could you please specify what locale is used on your PC?

Hi,

Here’s a screenshot with the region settings from the Windows machine this was reproduced on.
Please let me know if you need any further infromation.

Screenshot_1.png (9.6 KB)

Thanks,
Amit

@operationsdotbcs In this case Aspose.Words use short date format pattern specified in the current culture to display the date value. You can change this patter to get the desired result. For example, see the following code:

CultureInfo currentCulture = Thread.CurrentThread.CurrentCulture;
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");

// This returns 'M/d/yyyy' on my side, to get the desired result the value is changed to 'd/M/yyyy'
Console.WriteLine(Thread.CurrentThread.CurrentCulture.DateTimeFormat.ShortDatePattern);
Thread.CurrentThread.CurrentCulture.DateTimeFormat.ShortDatePattern = "d/M/yyyy";

Document doc = new Document(@"C:\Temp\in.docx");
doc.Save(@"C:\Temp\out.pdf");

Thread.CurrentThread.CurrentCulture = currentCulture;

The issues you have found earlier (filed as WORDSNET-23154) have been fixed in this Aspose.Words for .NET 22.6 update also available on NuGet.