0

OS: Windows Server 2019, Acrobat Pro DC 2021.011

  1. My C# program calls Acrobat converting PDF to Word.docx. I used the code from Jie: How to convert PDF to Word using Acrobat SDK?
AcroPDDoc pdfd = new AcroPDDoc();
 pdfd.Open(sourceDoc.FileFullPath);
 Object jsObj = pdfd.GetJSObject();
 Type jsType = pdfd.GetType();
 //have to use acrobat javascript api because, acrobat
 object[] saveAsParam = { "newFile.doc", "com.adobe.acrobat.doc", "", false, false };
 var vrc = jsType.InvokeMember("saveAs",BindingFlags.InvokeMethod | BindingFlags.Public | BindingFlags.Instance,null, jsObj, saveAsParam, CultureInfo.InvariantCulture);

Every few days, the function does not create the word file and returns NULL: "var vrc = jsType.InvokeMember". Identifying the last good date Acrobat successfully created the docx file, I restore the Server from Backup. The Acrobat function works.

What may be causing this problem?

  1. In the same StackOverflow post, Subhobroto posted WinPython code to convert PDF to Word. Using Python 10.3.2, Error
avDoc = Dispatch("AcroExch.AVDoc") # Connect to Adobe Acrobat

# Open the input pdf file
ret = avDoc.Open(pdfFN)

# Python Error 
File "<COMObject AcroExch.AVDoc>", line 2, in Open
pywintypes.com_error: (-2147352562, 'Invalid number of parameters.', None, None)

What is the correct code?

Thanks for help.

G. Young
  • 41
  • 1
  • 7
  • 1) I'll look at resources. Thx. 2) More testing results. On a 2nd VM, I ran the same program. right after a booting the VM. The first time the program runs, same problem - NULL is returned and no Word file. – G. Young Feb 04 '22 at 04:13
  • Per Adobe, Acrobat Pro DC is supported on servers. https://helpx.adobe.com/acrobat/system-requirements.html Windows 11 (64 bit), Windows 10 (32 bit and 64 bit) version 1809 or later, Windows 8, 8.1 (32 bit and 64 bit)†, Windows 7 SP1 (32 bit and 64 bit), or Windows Server - 2008 R2 (64 bit), 2012 (64 bit), 2012 R2 (64 bit)†, 2016 (64 bit), or 2019 (64 bit) – G. Young Feb 04 '22 at 12:51
  • KJ Just going down the debug rabbit hole and appreciate the help. Fact I forgot to mention: I can always run the Acrobat DC app and Export to Word docx file. Even when the C# program fails, manually running the App successfully creates the Word.docx file. – G. Young Feb 04 '22 at 14:14

0 Answers0