How to convert PDF to Word using Acrobat SDK?

kkk picture kkk · Jul 5, 2012 · Viewed 9.5k times · Source

My .Net application needs to convert a PDF document to Word format programmatically.

I evaluated several products and found Acrobat X Pro, which gives a save as option where we can save the document in Word/Excel format. I tried to use Acrobat SDK but couldn't find proper documentation from where to start.

I looked into their IAC sample but couldn't understand how to call the menu item and make it execute the save as option.

Answer

jle picture jle · Dec 12, 2012

You can do this with Acrobat X Pro, but you need to use the javascript API in c#.

 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 };
 jsType.InvokeMember("saveAs",BindingFlags.InvokeMethod | BindingFlags.Public | BindingFlags.Instance,null, jsObj, saveAsParam, CultureInfo.InvariantCulture);

Hope that helps.