Hi,
We have code using Aspose.Slides/Cells/Words, in which we convert documents to images and images/charts contained within documents to images.
We’ve been noticing that when dealing with charts contained in images, the chart will often not match the charts as displayed in the original document. This specifically happens when dealing with 3D charts or charts containing legends.
As an example our Aspose.Cells code will loop over all shapes on a sheet and call ToImage() on the shape;
this.imageOptions.ImageFormat = System.Drawing.Imaging.ImageFormat.Png;
this.imageOptions.Transparent = true;
this.imageOptions.ChartImageType = System.Drawing.Imaging.ImageFormat.Png;
foreach (Aspose.Cells.Drawing.Shape shape in sheet.Shape)
{
using (MemoryStream memoryStream = new MemoryStream())
{
shape.ToImage(memoryStream, this.imageOptions);
// Use the stream…
}
}
Is there anything we can be doing to keep the rendered image matching how the original chart is displayed, for each of the Aspose libraries mentioned above. We need the image to be an accurate representation of the original
Tim
The 3 attached documents all display the 3D chart perspective issue when processed in their respective libraries.
Additionally, when chart3D.xlsx is processed in Aspose.Cells, the pie chart in the document has its legend altered from the orginal. In the original document the legend scale goes from 1-10 but in the rendered image the legend scale goes from 1-20.
We are using the most up to date libraries for Aspose.Cells, Aspose.Slides and Aspose.Words.
Thanks
Hi,
1) Area 3-D chart - The horizontal category axis intervals are wrong.
2) PIE 3-D exploded chart - The legend entries are rendered from 1-20 instead of 1-10.
e.g
Sample code:
Aspose.Cells.Workbook workbook = new Aspose.Cells.Workbook(“e:\test2\chart3D.xlsx”);
int i = 0;
foreach (Worksheet worksheet in workbook.Worksheets)
{
foreach (Chart chart in worksheet.Charts)
{
i = i + 1;
Bitmap image = chart.ToImage();
image.Save(“e:\test2\tst_chartimg__” + i.ToString() + “.png”, ImageFormat.Png);
}
}
Thanks for the replies regarding Word and Cells, is anyone able to confirm this bug from a Slides perspective? We can’t currently export chart images from PPTX documents, so for us issues are seen when generating a thumbnail of the slide.
We’ll be keen to hear back from you when you have a resolution to any of these issues.
Thanks
Tim
Hi Tim,
I have worked with the sample presentation file shared by you and have been able to generate the attached slide thumbnail on my end by using Aspose.Slides for .NET 8.4.0. The 3-D effects on chart are missing in generated thumbnail. Is this is the issue that you are having on your end. If yes, then I like to share that Aspose.Slides does not presently support 3-D effects in rendering and for this reason such effects are unavailable in rendered images. An issue with ID SLIDESNET-35118 has already been added in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be automatically notified once the issue will be resolved.
public static void GenPPTXThumbnail(String presName,String path)
{
//begin process of converting pptx to png and inserting db entries for these images.
PresentationEx pres = new PresentationEx(path + presName);
//some code here that doesn’t have to do with the presentationex class
for (int x = 0; x < pres.Slides.Count; x++)
{
Console.WriteLine(“Writing Slide {0} of {1}”, x, pres.Slides.Count);
//Access the first slide
var slide = pres.Slides[x];
//Create a full scale image
Image bmp = slide.GetThumbnail(2f, 2f);
bmp.Save(path+“Slides\PPTX_Thumb_”+(x+1).ToString()+".png", System.Drawing.Imaging.ImageFormat.Png);
}
}
We are sorry for your inconvenience,
Yes, this is the issue that we are having. Thanks for the update, any idea when this might be fixed in Aspose.Slides?
Tim
Hi Tim,
I like to share that 3-D rendering support is likely to get included in Aspose.Slides for .NET by end of Q2 of 2014. Once the 3-D rendering support will be available, the concerned issue will get resolved afterwards. I will share the feedback with you as soon as the issue will be available.
Many Thanks,
Hi,
Please try
the new version/fix: Aspose.Cells for .NET v7.7.2.5 We fixed the x-axis labels and legend items issues. But the
3D-perspective feature is not supported yet.
Once we support the 3D-perspective in rendering image files, we will let you know here.
Thank you.