I am getting this same message:
ErrorMesssage: Exception from HRESULT: 0x82191044
Stack Trace: at PDFXEdit.IPXV_ImportConverter.Convert(PXV_Inst pInst, Object pSrc, UInt32 nFlags, ICab pParams, IProgressMon pProgress, UInt32 hWndParent, Object pCtx)
at Dolphin.PDFProcess.PDFProcessTools.CreateDolphinPDF(String fileName, String outputFileName, Boolean deleteOriginal)
[10/5/2018 12:06:13 PM][ERROR][ThreadID:1] Error from PDF X-Change: Error [PXVLib]: Microsoft Office threw an exception.
With Microsoft Office 2016 installed and when I attempt to convert XLS and DOC files.
I have also seen it throw this error:
[10/5/2018 12:22:59 PM][ERROR][ThreadID:1] Error from PDF X-Change: Error [PXVLib]: No suitable version of Microsoft Office application has been found.
With the exact same file when executed from a service. But when I launch the program directly from the command line with that same file it works.
What specifically do I need to enable or allow to convert Office files? I know from a previous thread Microsoft Office had to be installed, but is there a specific component, registry setting, or feature I must allow?
Edit: Also, it seems that if I run the program from the command line, it is successfully, but if I launch it from a Windows Service, it is not. I basically have an executable that runs a single PDF command. This works perfectly, but if I launch it from a Windows Service with the code below, it fails:
Process testProcess = new Process();
if (PDFTools.pdfUser != "")
testProcess.StartInfo.Domain = PDFTools.domain;
testProcess.StartInfo.UserName = PDFTools.pdfUser;
testProcess.StartInfo.Password = PDFTools.pdfPassword;
Logger.Log("Executing PDF Process as: " + testProcess.StartInfo.Domain + @"\" + testProcess.StartInfo.UserName, 5);
testProcess.StartInfo.UseShellExecute = false;
testProcess.StartInfo.FileName = PDFTools.pdfProcessPath;
testProcess.StartInfo.CreateNoWindow = true;
testProcess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
testProcess.StartInfo.Arguments = "convert \"" + inputFile + "\" \"" + outputFile + "\" " + Convert.ToString(deleteOriginal);
Logger.Log("Attempting to Create PDF w/External Process. Arguements: " + testProcess.StartInfo.Arguments, 5);
testProcess.StartInfo.RedirectStandardOutput = true;
Logger.Log("Create PDF Process Started. waiting maximum of " + 1000 * 60 * PDFTools.pdfToolsTimeoutInMin + " seconds for completion", 5);
testProcess.WaitForExit(1000 * 60 * PDFTools.pdfToolsTimeoutInMin);
returnValue = false;
string mainOutput = testProcess.StandardOutput.ReadToEnd();
Logger.Log("CreatePDF from: " + inputFile + " main output: " + mainOutput, 5);
returnValue = Convert.ToBoolean(mainOutput);
catch (Exception ex)
Logger.Log("Exception", ex, 1);
Basically I just want to convert documents to PDF as part of my larger windows service. This seems to work for all documents BUT microsoft office documents. However the conversion code run directly outside of the service will convert office documents.
I'm guessing it has something to do with office conversion launching a UI or requiring permissions or something, though the service is running as an administrator on the machine. Is there any way to convert an office doc from a windows service?