Problems with office automation in asp.net. I can use alternatives like open-office if I knew how

I have an ASP.NET 2.0 web application that needs to download a ppt file and then extract slides for images. To do this, I imported the assembly office.dll and Microsoft.Office.Interop.PowerPoint.dll and wrote the following code

public static int ExtractImages(string ppt, string targetPath, int width, int height)
    {
        var pptApplication = new ApplicationClass();

        var pptPresentation = pptApplication.Presentations.Open(ppt, MsoTriState.msoTrue, MsoTriState.msoFalse, MsoTriState.msoFalse);

        var slides = new List<string>();

        for (var i = 1; i <= pptPresentation.Slides.Count; i++)
        {
            var target = string.Format(targetPath, i);
            pptPresentation.Slides[i].Export(target, "jpg", width, height);
            slides.Add(new FileInfo(target).Name);
        }

        pptPresentation.Close();

        return slides.Count;
}

If I run this code on my local computer, in asp.net or an executable file, it works fine. But if I try to run it on a production server, I get the following error:

System.Runtime.InteropServices.COMException(0x80004005): PowerPoint . Microsoft.Office.Interop.PowerPoint.Presentations.Open(String FileName, MsoTriState ReadOnly, MsoTriState , MsoTriState WithWindow) PPTImageExtractor.PptConversor.ExtractImages(String caminhoPpt, String caminhoDestino, Int32 largura, Int32 altura, String caminhoThumbs, Int32 larguraThumb, Int32 alturaThumb, Boolean geraXml) Upload.ProcessRequest( HttpContext)

NT AUTHORITY\NETWORK SERVICE. IIS . , , .

- office 2010. 2007 . , Office 2003, .

, , -. - IIS7 .

, Open- API, , . DLLImport , , open-office -. , , .

.

+5
6

Office Interop ASP.NET. . Office.

, , Windows Server 2008 , :

Windows 2008 Server x64: C:\Windows\SysWOW64\config\systemprofile\ Windows 2008 Server x86: C:\Windows\System32\config\systemprofile\

+10

Office Automation .

http://support.microsoft.com/kb/257757

Microsoft Microsoft Office , ( ASP, ASP.NET, DCOM NT), Office / , Office .

, , MS ...

+1

( , ), :

:

C:\Windows\SysWOW64\Config\systemprofile\Desktop

C:\Windows\System32\config\systemprofile\ ( )

Windows Server 2012 R2 Standard

+1

Interop , , . I.e, , , Office . , , . , , - , ( PowerPoint).

PowerPoint , , PowerPoint. , Aspose (Aspose.Slides), .

PowerPoint 2007, XML- Open Office , . . Open XML Office (2007) Open XML SDK 2.0 Microsoft Office.

0

, , . , 2007+. zip . .zip, .

, . .

0

Office Interop ASP.NET. . Office.

, , Murthy Pantham 64- Windows 7 Professional Office 2010. 1 (SP1) Windows 7 Office 2010, , , -, , 2008. , -.

0

All Articles