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
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..
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