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

Free Support Forum - aspose.com

ISlideCollection.AddFromPdf Doesn't Add Charts from PDF File

Hi,

I am trying to add/convert my pdf report to pptx using Aspose.Slides.Net library.
But if my report contains a charts, the presentation is not being created correctly.
When I open the PowerPoint file I see error message

image.png (4.8 KB)

I tried to repair the presentation file, but the charts are not in report anymore and it shows some blank slides

Here is my code

var licenseSlides = new Aspose.Slides.License();
licenseSlides.SetLicense("Aspose.Slides.NET.lic");
var fileName = "test";
fileName = "C:\\Download\\pptx\\" + fileName;
var pdfBytes = File.ReadAllBytes(fileName + ".pdf");
using (Aspose.Slides.Presentation pres = new Aspose.Slides.Presentation())
using (Stream stream = new MemoryStream(pdfBytes))
{
      pres.SlideSize.Orientation = Aspose.Slides.SlideOrientation.Landscape;
      pres.Slides.AddFromPdf(stream);
      if (pres.Slides.Count > 1)
      {
           pres.Slides.RemoveAt(0);
      }
      pres.Save(fileName + ".pptx", Aspose.Slides.Export.SaveFormat.Pptx);
 }

@skhojoyan,
Thank you for contacting support.

Please check your results using the latest version of Aspose.Slides if it is possible. If the issue persists, please share the following data and information:

  • input PDF file
  • OS version where the code was executed
  • .NET target platform in your app
  • Aspose.Slides version you used

@skhojoyan,
Thank you for the additional information. I was unable to generate the PPTX file, the PDF import hangs on my end. I’ve added a ticket with ID SLIDESNET-43341 to our issue tracking system. We apologize for any inconvenience. Our development team will investigate the case. You will be notified when the issue is resolved.

1 Like

Thanks, hope to see this issue fixed :crossed_fingers:

1 Like

Hi @Andrey_Potapov,
Do you have updates on this ticket?

@skhojoyan,
As far as I can see, the issue has a normal priority. Unfortunately, the issue has not been scheduled for investigation yet.