Spire.Presentation is a professional PowerPoint® compatible library that enables developers to create, read, write, modify, convert and Print PowerPoint documents. Get free and professional technical support for Spire.Presentation for .NET, Java, Android, C++, Python.

Mon Feb 07, 2022 5:35 pm

Hello,
I'm using Spire.Office 6.9.1 version in an azure function in .NET Core 3.1.
I'm trying to convert a pptx file into a pdf format.
I'm using this code :

Stream stream = new MemoryStream(file.Content);
Spire.Presentation.Presentation presentation = new Spire.Presentation.Presentation();
presentation.LoadFromStream(stream, Spire.Presentation.FileFormat.Auto);
presentation.SaveToFile(newfileName, Spire.Presentation.FileFormat.PDF);


file.Content is the array of bytes of my pptx file.
newFileName is a complete path with the name of the pdf doc I want to create.

When running this function localy on my computer, it works perfectly. But when it runs on Azure, i get this exception :

"ExceptionMessage":"Object reference not set to an instance of an object.","ExceptionStackTrace":" at spr厈..ctor(String A_0, Single A_1, FontStyle A_2, Boolean A_3)\r\n at spr厈..ctor(String A_0, Single A_1, FontStyle A_2)\r\n at spr区.ᜀ(Single A_0, Boolean A_1)\r\n at spr剶.ᜀ(String A_0, PointF A_1, spr区 A_2)\r\n at spr俞.ᜀ(spr劯 A_0, spr剳 A_1, Hashtable A_2, spr侬 A_3)\r\n at spr俞.ᜀ(Boolean A_0, spr剳 A_1, Hashtable A_2, spr侬 A_3, FileFormat A_4)\r\n at spr剱.ᜀ(spr俘 A_0, Stream A_1, spr剭 A_2)\r\n at spr俘.ᜀ(Stream A_0, spr割 A_1, spr剳 A_2)\r\n at spr俘.ᜀ(String A_0, spr割 A_1)\r\n at Spire.Presentation.Presentation.SaveToFile(String file, FileFormat fileFormat)\r\n at Azure.ConvertToPdf.ManagePdf.MergePdfs(List`1 files)\r\n at Azure.ConvertToPdf.Function2.Run(HttpRequest req, ILogger log)","ExceptionSource":"Spire.Presentation","

Can you help me ?

Best Regards.
Marmont Lucas

MarmontLucas
 
Posts: 2
Joined: Mon Feb 07, 2022 5:25 pm

Tue Feb 08, 2022 6:44 am

Hello,

Thank you for your inquiry.
The issue you mentioned is mostly related to the content and layout of the PowerPoint file. To help us investigate your issue quickly and effectively, please provide your input PowerPoint file. You could attach it here or send it to us via email (support@e-iceblue.com). Thanks in advance.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1657
Joined: Wed Apr 07, 2021 2:50 am

Return to Spire.Presentation