1 year ago

#135065

test-img

G. Young

PDF to Word using Acrobat SDK

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.

pdf

ms-word

acrobat-sdk

0 Answers

Your Answer

Accepted video resources