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

Free Support Forum - aspose.com

Converting Slides to PDF Works with Win Forms, but Not with Web Application

EDIT: I’m watching it in debug. It saves to the folder in the web application, but the format is definitely HTML. I have nowhere else to look - it does the save, I look at the file immediately. It won’t open in Adobe Reader or a browser (Chrome and Edge have been tried), but when I open it in Notepad, it is definitely in HTML format. The exact same code and Aspose.Slides.NET library (21.9) in my test app (windows forms) saves it in a different format.

        Using powerPoint As New Presentation(paramExportFilePath)

            Dim po As New Aspose.Slides.Export.PdfOptions() With {
                    .Compliance = Aspose.Slides.Export.PdfCompliance.Pdf15
                }

            powerPoint.Save(newFileName, SaveFormat.Pdf, po)

        End Using

Hi - I’m running a conversion of a powerpoint presentation and it works successfully from a windows forms application, but not on our web application.

I realize this probably has something to do with our environment, but the code is the same, the version (21.9) is the same, but does not work from the web application. If I copy the saved file from the web server to my local machine, it still will not open (“failed to load pdf document” is the message). So I’m thinking something is happening during the save.

The difference I can see is that the one from Windows Forms looks to be a binary file, and the one on the website is HTML.

My problem here was “SafeFormat.Pdf” instead of “Export.SaveFormat.Pdf” if anyone has the same problem. It was a namespace issue. Cells.SafeFormat.Pdf is accepted there, but doesn’t work. It was one place where I wasn’t specifying the full namespace.

@steve.assurx,
Thank you for contacting support.

It seems to be the issue does not relate to Aspose.Slides API. You can try to create simple projects (Windows Forms and Web application) and isolate the problem.

I found the issue, and posted it right before your response.

@steve.assurx,
I am sorry for the misunderstanding. We are glad you resolved the issue yourself.