cognidox / OfficeToPDF

A command line tool to convert Microsoft Office documents to PDFs
https://www.cognidox.com/
Other
610 stars 137 forks source link

RPC_E_CALL_REJECTED after converting powerpoint prevents further conversion of powerpoint #36

Open pantsmann opened 5 years ago

pantsmann commented 5 years ago

I'm running version 1.8.22.0

When I convert a PowerPoint document to pdf (running on an automation server), with the following options /print /readonly, the conversion succeeds, but I get the following exception and POWERPNT.EXE doesn't close. On subsequent runs, I get the same exception, but the conversion doesn't succeed until I shut down POWERPNT.EXE

The exception: Call was rejected by callee. (Exception from HRESULT: 0x80010001 (RPC_E_CALL_REJECTED))

error code: 3

PowerPoint file (just a dummy file): testPPnt-3d.pptx

On the rare (very very rare) occasions when I don't get the exception everything runs fine and PowerPoint closes and I can rerun the conversion. The conversion is triggered by an email, with the pptx file attached, that I'm sending manually for testing so there are generally several minutes between tests. I wouldn't expect this to be the case in production.

This script will also be converting other doctypes, but I haven't seen any problems with other docs like Word.

Any help would be very much appreciated.

vittala commented 5 years ago

Hi

Some questions to help us better understand what's going on:

Cheers Vittal

pantsmann commented 5 years ago

As a reminder, the conversion succeeds. That is, the pdf file is created despite the exception being thrown. POWERPNT.EXE doesn't close and whatever state POWERPNT.EXE is in at that point prevents subsequent converting of PowerPoint files to pdfs until POWERPNT.EXE is killed.

At current, my code watches for the exception and kills POWERPNT.EXE after each conversion. Unfortunately, I haven't found a way of uniquely identifying the POWERPNT.EXE process that is in a bad state so any POWERPNT.EXE process running at that time is terminated.