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.

Tue Nov 14, 2023 4:55 pm

We arex using FreeSpire.Presentation version 7.8.0 to read the ppt. Its runs for a few times then it starts giving Unknow file format error then either we have to wait for sometime or restart our azure app service to make it work again. Anyone faced this issue or has idea about solution?

Below is the stack trace and function.

Error : Unknown file format.
StackTrace : at sprᦧ.ᜀ() at sprᦧ..ctor(Stream A_0) at sprᦩ.ᜂ() at sprᦩ.ᜄ() at spr᦯.ᜀ(Stream A_0) at spr᝚.ᜁ(Stream A_0) at spr᝚.ᜃ(Stream A_0) at spr᝚..ctor(Stream A_0, sprᩓ A_1) at Spire.Presentation.Presentation.LoadFromStream(Stream stream, FileFormat fileFormat) at Refract.Protrail.Api.Controllers.CompanyManagementDetailController.LoadTemplate(String template) in


//Function that reads the ppt
// LoadFromFile also gives the same error
private Presentation LoadTemplate(string template)
{

using (Presentation ppt = new Spire.Presentation.Presentation())
{
string templatePath = _webHostEnvironment.ContentRootPath + "\\Templates\\" + template;
var bytesTemplate = System.IO.File.ReadAllBytes(templatePath);
using (var ms = new MemoryStream(bytesTemplate,true))
{
try
{
ppt.LoadFromStream(ms, FileFormat.Pptx2013);
return ppt;
}
catch
{
ppt.LoadFromStream(ms, FileFormat.Pptx2013);
return ppt;
}
}
}
}

atulonweb
 
Posts: 1
Joined: Wed Mar 29, 2023 8:25 am

Wed Nov 15, 2023 3:35 am

Hello,

Thanks for your inquiry.
Based on the information provided, we suggest that you use our latest commercial version(Spire.Presentation Pack Hotfix Version:8.10.2) for testing, which contains more hotfixes and new features. If the issue still exists after testing, please provide your complete test project (including input files) and test environment (such as Windows7, 64bit and region setting (E.g. China, Chinese)). You could attach them here or send them to us via email (support@e-iceblue.com). Thanks in advance.
In addition, please modify the code to load the document to "ppt.LoadFromStream(ms, FileFormat.Auto);".

Sincerely,
Annika
E-iceblue support team
User avatar

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

Return to Spire.Presentation