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.

Fri Mar 22, 2024 2:18 pm

Dear e-iceblue Support Team,

I hope this email finds you well. I am writing to seek assistance with a problem I encountered while working with the Spire.Presentation library.
Issue Description: When attempting to initialize and load a PowerPoint file from a specified path, I encountered an error. The presentation fails to load because it does not contain any slides.

Code Snippet:
varpptFolderPath = (AppDomain.CurrentDomain.BaseDirectory + "DefaultPPTTemplate.pptx");
Spire.Presentation.Presentation pptxDoc = new();
pptxDoc.LoadFromFile(pptFolderPath);

Exception Details:
System.IO.IOException: 'The parameter is incorrect. : 'C:\Users\santhosh.sivala\Downloads\Shapes\UT_Q2_Alignment_Error\EmptyPowerPoint Presentation.pptx''

Request for Assistance: Could you please guide me on how to handle this situation? Is there a way to detect if a PowerPoint file is empty (i.e., contains no slides) before attempting to load it?
Thank you for your prompt attention to this matter. I appreciate any insights or solutions you can provide.

sivalasanthosh
 
Posts: 5
Joined: Fri Mar 22, 2024 1:07 pm

Mon Mar 25, 2024 4:03 am

Hello,

Thanks for your inquiry.
Kindly note that a file with a size of 0kb means it does not contain any information describing the file, and our product cannot recognize it as a PowerPoint file, so it will prompt an error:"The parameter is incorrect". Sorry, this error is not a defect in our product, that's how we designed it.
You can use try catch to catch this exception, but you still cannot further manipulate this file. Hope you can understand.

Sincerely,
William
E-iceblue support team
User avatar

William.Zhang
 
Posts: 454
Joined: Mon Dec 27, 2021 2:23 am

Return to Spire.Presentation