Code snippet:
using var client = new WebClient();
var stream = new MemoryStream(client.DownloadData(fileUrl));
//Open the existing PowerPoint presentation.
using var pptxDoc = Presentation.Open(stream);
//Convert the PowerPoint document to PDF document.
using var pdfDocument = PresentationToPdfConverter.Convert(pptxDoc);
//Creates an instance of memory stream.
using MemoryStream pdfStream = new MemoryStream();
//Save the converted PDF document to memory stream.
pdfDocument.Save(pdfStream);
var pdfStreamArray = pdfStream.ToArray();
return File(pdfStreamArray, ContentTypes.PDF);
StackTrace:
Not allowing me to upload pptx file. But it is 10 MB file.