I am getting this error
System.ArgumentException: No codec available for format:b96b3cae-0728-11d3-9d7b-0000f81ef32e
at System.Drawing.Image.Save(Stream stream, ImageFormat format)
atPresentation )
atresentation , Stream , PresentationTypeEx , IPptxOptions, InterruptionToken )
at Aspose.Slides.Presentation.(Stream , PresentationTypeEx , IPptxOptions )
at Aspose.Slides.Presentation.Save(Stream stream, SaveFormat format, ISaveOptions options)
at Aspose.Slides.Presentation.Save(String fname, SaveFormat format)
at IRA.Core.Services.IraReportService.GetIraPPTX(IraData data) in D:\Projects\stt-internal-reporting-automation\code\internal-reporting-automation\api-dot-net\IRA.Core.Services\IraReportService.cs:line 119
when i try to deploy my .NET application in the dotnet server. I am using .NET version 5 and Aspose.Slides.NET" Version=“22.11.0” .
This is the code file where i am generating the ppt.
private Presentation pptx = new Presentation();
private static Random random = new Random();
public static string RandomString(int length)
{
const string chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
return new string(Enumerable.Repeat(chars, length)
.Select(s => s[random.Next(s.Length)]).ToArray());
}
public string GetIraPPTX(IraData data)
{
try
{
License license = new License();
license.SetLicense("Aspose.Slidesfor.NET.lic");
bool isLinux = RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
string outputDirectory;
if (isLinux)
{
outputDirectory = @"/home/micro/storage/TempPPTX/" + RandomString(10) + ".pptx";
}
else
{
// outputDirectory = @"D:\Desktop\projects\generatedPPTs\" + RandomString(10) + ".pptx";
outputDirectory = @"C:\Users\MohammadKaifKhan\Desktop\Projects\generatedPPTx\" + RandomString(10) + ".pdf";
}
pptx.Slides[0].Remove();
// First two slides
DatacenterSlide cs = new DatacenterSlide();
Presentation csPPTX = cs.getSlide(presTemplate, data);
MergePPTX(csPPTX);
pptx.Save(outputDirectory, SaveFormat.Pptx);
}
}
protected void MergePPTX(Presentation child)
{
foreach (ISlide slide in child.Slides)
{
pptx.Slides.AddClone(slide);
}
}
(Ignore the syntax errors)