We have a requirement to convert downloaded PPT or PPTX files to image files. We developed this work locally with the following (POC code):
Application pptApplication = new Application();
Microsoft.Office.Interop.PowerPoint.Presentation pptPresentation = pptApplication.Presentations.Open2007(filePath, MsoTriState.msoFalse, MsoTriState.msoFalse, MsoTriState.msoFalse);
List<string> files = new List<string>();
for (int i = 1; i <= pptPresentation.Slides.Count; i++)
{
pptPresentation.SaveCopyAs(serverPath + randomId, PpSaveAsFileType.ppSaveAsPNG, MsoTriState.msoTrue);
files.Add(root + "Uploads/Slide" + i + ".PNG");
}
pptPresentation.Close();
Now that this code is deployed to Windows Server 2012 R2, I get the following error:
This error looks like a permission issue, and when I googled, I found several solutions that I tried with no luck, here are some of them:
.
.