Problem converting the charts

I bought the Aspose Total for Java software licence version 2.2 and due to some issues during the development I downloaded the version 2.3.

We have used Aspose Slide in order to split a presentation to a slide collection.

It seems that the charts of a ppt are not captured properly.

E.G. If i create a ppt, insert a chart (ppt functionality Insert\Chart) and try to split the slide collection does not show the Chart.

How can we resolve this problem? Is it possible to split also the charts?

Thanks in advance

Dear Nicholas,

Thanks for using Aspose.

Are you splitting a single presentation into multiple presentations? What do you mean by splitting a chart?

Aspose.Slides allows you to split presentation but not charts.

Please clarify and attach the source presentation to look into this issue.

FYI: In case, you have older version of Aspose.Slides for JAVA, you can update it with latest one from this link.

Dear Shakeel,

Here I attach an example: a ppt with a chart inside and the img generated.

I think that there is a problem in the rendering of charts.

Could you confirm or give us a solution?

Thanks in advance and happy Christmas!

Dear Nicholas,

I have checked with the latest version of Aspose.Slides for JAVA 1.8.8.0 with the following code. The problem does not exist. Please see the output presentation of the below code.

CODE:

Presentation pres = new Presentation(new FileInputStream("D:\\downloads\\New+Microsoft+PowerPoint+Presentation.ppt"));
Slide sld = pres.getSlideByPosition(1);

Presentation dstPres = new Presentation();
Slide dstSld = pres.cloneSlide(sld, 1, dstPres, new TreeMap());

dstPres.write(new FileOutputStream("c:\\outj.ppt"));

Happy Christmas and best wishes to you…

Dear Shakeel,

I have already noticed that the ppt is well split.

In my opinion the problem is related to the thumbnail generated from the slide. Inside the API I can see that there is a function (getThumbnail) that is supposed to generate the thumbnail of the current slide. We call it inside our code.

The result is that inside the slide we are not able to see the chart (let's see the attachment NewMicrosoftPowerPointPresentation1_preview.jpg).

Maybe we have called it in a wrong way or there is a possible work-around to solve the problem. Please could you help us?

Thanks in advance

Hello Nicholas,

Do you have Aspose.Metafiles.jar in the classpath? Charts in presentations are
wmf/emf metafiles and to render it properly you should have also Aspose.Metafiles library.

No we haven't added it.

Please could you provide an example of how to use it?

This is our code in which we create the thumbnail of the ppt slide:

# Image Thumbnail
imageThumbnail=srcPres.getSlideByPosition(i).getThumbnail(dimThumbnail)
output = ByteArrayOutputStream()
ImageIO.write(imageThumbnail,"jpg",output)
thumbnail=newdocument(kmSession,slideName+" Thumbnail",hc)
thumbnail.setFileName(fileNameOnlyPrefix+str(i)+"_thumbnail.jpg")
thumbnail.setMimeType('image/pjpeg')
thumbnail.doNotIndex()
thumbnail.commit(ByteArrayInputStream(output.toByteArray()))

# Image preview
imagePreview=srcPres.getSlideByPosition(i).getThumbnail(dimPreview)
output = ByteArrayOutputStream()
ImageIO.write(imagePreview,"jpg",output)
jpg=newdocument(kmSession,slideName+" Preview",hc)
jpg.setFileName(fileNameOnlyPrefix+str(i)+"_preview.jpg")
jpg.setMimeType("image/pjpeg")
jpg.setCustomType("Power Point Slide Image")
jpg.doNotIndex()
oLibrary.setCustomAttribute(jpg,"ITS_instance_of","CTD_PPTImage","String",1,0,0)
oLibrary.setCustomAttribute(jpg,"Thumbnail-Large",thumbnail.getOid(),"OID",0,0,0)
jpg.commit(ByteArrayInputStream(output.toByteArray()))

What should we add?

Thanks in advance

Dear Alexey,

finally I was able to fix the problem...thanks to your post!

Thanks you very much!

Happy New Year!

Cristian