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

Free Support Forum - aspose.com

Converting charts from WORD to image

Hi,
I have been working on a project that is using ASPOSE Cells to convert charts in WORD to images that can be used in HTML version of the document.
The way it is done now is as following:
- we are extracting the ChartPart object from the document
- we have a dynamic Excel template that had one chart inserted in it
- using OOXML SDK Tool we have extracted the code to create the Workbook
- in that template we substitute ChartPart that is in there with the ChartPart that we extracted from the document
- finally using ASPOSE and loading that dynamic excel template we call ToImage() on the chart object

We have encountered quite a few problems using that approach.
The output created using that approach does not exactly match the chart in WORD document.
Examples of issues that we encoutered:
- colours of the chart are different
- x-axis labels are different (even if specified specific ranges in WORD)
- textboxes or shapes that are inserted in tha chart area are not present in the image version
- labels on the x-axis are rotated
- dates that are on the x-axis seem to be ocasionally converted into weird formats like TICKS or suddenly the year is added even tho the document does not have it

Is the process that we are using now correct? Can you please advise on a better way to do it if possible?

Thanks,
Bart

Hi,


Well, I am afraid, Aspose.Cells cannot help you much as it does not support to convert or extract Chart object in a word document, the component is rather Spreadsheet management library that can create, manipulate, render MS Excel files etc. I think and it looks your issue lies in the following parts and might not have any links with Aspose.Cells component:
- we are extracting the ChartPart object from the document
- we have a dynamic Excel template that had one chart inserted in it
- using OOXML SDK Tool we have extracted the code to create the Workbook
- in that template we substitute ChartPart that is in there with the ChartPart that we extracted from the document

Please look into the above sections for your custom code segment by yourself. I am afraid, and we are sorry that we might not help you much here as we can only provide help or fix the relevant issue if your issue lies in the Chart to Image feature when you load the template file and convert the chart in the template to image file by Aspose.Cells APIs. By the way, if you think the replaced chart is fine tuned (similar to MS Word’s chart) in your dynamic Excel file (you may simply save the Excel file to disk to open it into MS Excel for confirmation), please provide your final template Excel file (after your custom processes), we will do the conversion test (Chart to Image) by Aspose.Cells APIs (latest version). If we found the issue, we will log it into our database, so we could figure it out soon.

Thank you.