How to convert mpp to pdf in c# .net

108 Views Asked by At

I want to convert my mpp file to pdf in C# .net code. I have already tried

appclass.DocumentExport(FileUploadFolderPath + "\\" + fileName, MPP.PjDocExportType.pjPDF, true, true, false);

And this works fine in my local system, but doesn't work when run from my server(maybe because the file is not quitting then how can i make it quit).I am using VS 2017 and .net version 3.1.24. Checked print (pdf) driver . it is there in the server. the error comes from line

appclass.DocumentExport(FileUploadFolderPath + "" + fileName, MPP.PjDocExportType.pjPDF, true, true, false);

Request Object: System.Runtime.InteropServices.COMException (0x000003EC): An unexpected error occurred with the method.

I have already tried adding

appclass.Quit();

And after few calls to the api my mpp file is also not getting created, I have used the following code to create mpp

appclass.FileSaveAs(FileUploadFolderPath + "\\" + fileName); 
appclass.FileClose(Microsoft.Office.Interop.MSProject.PjSaveType.pjSave);
0

There are 0 best solutions below