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.

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

@skhojoyan,
I’ve requested information from our developers for you. We will reply to you as soon as possible.

@skhojoyan,
Our developers will look into the case next week.

1 Like

@skhojoyan,
Our developers investigated the case. Even if the PDF file is visualized properly in PDF readers, the document is broken. The PDF file is 96 kB, but if you open it in Adobe Acrobat and then save it, it will only be 80 kB (many empty objects will be deleted). Could you please clarify how was this PDF file created?

Hi Andrey,
We used iTextSharp.text.pdf.PdfWriter to create PDF file.
Thanks
Sergey

@skhojoyan,
Thank you for the additional information. I’ve forwarded it to our development team.

Hi Andrey,
I see the status if this ticket has been changed to Resolved.
Does this mean that it will be included in next update?
Thanks
Sergey

@skhojoyan,
Yes, the issue has been resolved. A fix will be included in Aspose.Slides 22.10. This release will be published in the second half of October.

1 Like

A post was split to a new topic: Some Labels in Charts Are Not Rotated Correctly when Importing PDF

The issues you have found earlier (filed as SLIDESNET-43341) have been fixed in Aspose.Slides for .NET 22.10 (ZIP, MSI).
You can check all fixes on the Release Notes page.
You can also find the latest version of our library on the Product Download page.

Hi @Andrey_Potapov,
We have found some more files that are not working Sergey_test_23012023_183500.PDF (92.9 KB)
Sergey_test_23012023_183841.PDF (108.1 KB)
Can you please take a look?
Thanks,
Sergey

@skhojoyan,
With Aspose.Slides 22.12, I get an ArgumentException error while importing the Sergey_test_23012023_183500.PDF file to a new presentation and an AccessViolationException error while importing the Sergey_test_23012023_183841.PDF document. Could you please confirm that you encountered the same errors?

@skhojoyan,
Let’s continue the discussion here.