Hello,
Hi,
Hello,
Since the given issue was clearly reproducible in one our customers production environment, we have analysed it further to figure out the root cause.
After analysis we found that issue is environment specific as it is not reproducible on all machines. That could be the reason you were also not able to reproduce this in your setup.
To facilitate the troubleshooting we have created a VM with public IP where the issue is clearly reproducible.
Following are the steps to reproduce the issue:
- RDC to the following machine:
- Machine IP: 52.163.124.173
- User Name: testuser
- Password: Aspose123456
- Go to folder C:/ForAspose which contains following:
- Two excel documents - Chart1.xlsm and Chart2.xlsm where each contain chart of same size.
- Java test client ChartSizingIssue - both class file and java file.
- Aspose jar file
- Aspose licence file “Aspose.Total.Java.lic”. This is the dummy file you have to replace it with valid license file or update its content during execution of the program.
- run.bat file to run the program.
-
Execute run.bat file which will generate output folder and create 2 chart files.
-
Now compare output of both PDF files side by side by changing zoom factor to 100%.
I have also attached the comparison of both output PDF files for your reference.
This is very critical issue as layout of customer documents containing these charts is heavily affected.
So kindly look into this on priority provide the fix ASAP.
Thanks,
Neeraj
OutputComparison.PNG (50.4 KB)
Thanks for providing us details and screenshot.
We have evaluated your issue a bit. We found Chart1.xlsm default font is “Arial Narrow”, it is missed on the user’s env.
e.g
Sample code:
FontConfigs.setFontExclusiveSources(new FontSourceBase[]{new FolderFontSource(FontExcDir, false)});
Workbook workbook1 = new Workbook("D:\\Download\\ForAspose\\CHART2.xlsm");
WorksheetCollection ws1 = workbook1.getWorksheets();
Worksheet sheet11 = ws1.get("ReportCharts");
Chart chart1 = sheet11.getCharts().get("GFTU_price vs EPS");
chart1.toPdf(TMP_DIR + "chart2.pdf");
Workbook workbook = new Workbook("D:\\Download\\ForAspose\\CHART1.xlsm");
WorksheetCollection ws = workbook.getWorksheets();
Worksheet sheet1 = ws.get("8 charts");
Chart chart = sheet1.getCharts().get("GFTU_WIDTH TEST_CHART");
chart.toPdf(TMP_DIR + "chart1.pdf");
Using the code and only putting Arial font (arial.ttf) to the FontExcDir, the issue can be reproduced on your end. Then add “Arial Narrow” font to the FontExcDir, the output will be ok.
Thank you.
Hi,
Thanks to figure out that installing fonts works well. However, I was wondering that no where in the charts we are using “Arial Narrow” fonts although it is being used else where, then why the behaviour is appearing in those charts PDF rendering?
As far as your license related concern, we have a valid Aspose license however, I did not use that license in the public VM as Aspose topics are public and anyone can view that.
Thanks,
Neeraj
Good to know that your issue is sorted out by installing the required font (“Arial Narrow”). Well, for rendering of shapes, default font (used in the workbook) is needed. We may provide further details for your reference.
You did it well not to include license file on public VM. By the way, did we show any concern regarding it?
Thank you.