Converting .pptx file to pdf throws System.NotSupportedException

I am trying to convert ppt file to pdf using Syncfusion.PresentationToPdfComverter.Wpf but I am getting System.NotSupportedException (No data is available for encoding 437. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method.)

Below is the code :

StorageFile f = await StorageFile.GetFileFromPathAsync(path); //path the loc of the file

var fStream = await f.OpenAsync(FileAccessMode.ReadWrite);

var reader = new DataReader(fStream.GetInputStreamAt(0));

var bytes = new byte[fStream.Size];

await reader.LoadAsync((uint)fStream.Size);

 reader.ReadBytes(bytes);

var stream = new MemoryStream(bytes);


Presentation presentation = Presentation.Open(stream);

PdfDocument pdfDocument = PresentationToPdfConverter.Convert(presentation);

 pdfDocument.Save("PPTToPDF.pdf");

 pdfDocument.Close(true);

 presentation.Close();

I found similar issue but it was about opening a excel worksheet. Can someone help me with this? Thanks


5 Replies

HC Hemalatha Chiranjeevulu Syncfusion Team July 16, 2021 04:27 PM UTC

Hi Dennis,

Thank you for contacting Syncfusion support.

From the details, we suspect that you are using PPT format document. The Essential Presentation library doesn’t support the PPT format document. So, reported exception issue occurs while converting PPT format document to PDF. The current version of Essential Presentation supports the .PPTX, .PPTM, .POTX, .POTM file formats only. So, we suggest you to open the input PPT format document in Microsoft Power point and save as PPTX format. Then, convert to PDF using Presentation.

Please refer our UG documentation link to get more details.
https://help.syncfusion.com/file-formats/presentation/overview

We have prepared the sample to convert PPTX format document to PDF and it can be downloaded from the below link:
https://www.syncfusion.com/downloads/support/forum/167272/ze/CreatePresentationSample_UWP638978483

Could you please check and confirm us whether you are facing the same issue while using PPTX format document. If yes, could you please share the input presentation document which used at your end to reproduce the exact issue at our end. And also, share the Syncfusion product version which used at your end. Thereby, we will analyze further on the reported problem and update you with appropriate solution at the earliest.

Please let us know if you have any other questions.

Regards,
Hemalatha C



DA Dennis Arriola July 19, 2021 06:16 AM UTC

Hello Hemalatha C,

Thank you for your quick response.

I was using Syncfusion.PresentationToPdfConverter.Wpf version 19.2.0.47 in our UWP project since this was what I found in my research and I was trying to convert pptx file.

By the way, I tried your app and it worked! I will 
Syncfusion.PresentationRenderer.Net.Core instead of  Syncfusion.PresentationToPdfConverter.Wpf. Thank you.

Do you still need the file I'm trying to convert?

Thank you very much..



HC Hemalatha Chiranjeevulu Syncfusion Team July 20, 2021 06:40 PM UTC

Hi Dennis,

Thank you for sharing us the details.

From the details, we have found that you are using Syncfusion.PresentationToPdfConverter.Wpf package in UWP platform. We strongly recommend you to use Syncfusion.PresentationRenderer.Net.Core NuGet package for presentation document to pdfconversion in UWP platform to resolve the reported issue.

If you are facing any other issue after using Syncfusion.PresentationRenderer.Net.Core means, could you please share the input presentation document to reproduce the issue. Thereby, we will analyze the issue and will share the details at the earliest.

Note: If you have any confidential data in your input document, please replace with some dummy data and provide us the same. We just need your document to check on your requirement.

Please let us know if you have any other questions.

Regards,
Hemalatha C



DA Dennis Arriola July 22, 2021 05:18 AM UTC

Hello Hemalatha,

I have no concern so far with  Syncfusion.PresentationRenderer.Net.Core.
I will just create another thread if ever I will encounter issue(s) in   Syncfusion.PresentationRenderer.Net.Core.

Thank you very much. :)

All the best,
Dennis Arriola



HC Hemalatha Chiranjeevulu Syncfusion Team July 23, 2021 04:19 PM UTC

Hi Dennis,

Thank you for your update.

We are glad to know that your problem has been fixed with Syncfusion.PresentationRenderer.Net.Core NuGet package.

Please let us know if you need any further assistance. We are happy to assist you as always.

Regards,
Hemalatha C


Loader.
Up arrow icon