Copy link to clipboard
Copied
I'm using Acrobat DC. Looking for javascript code that I can use in a button to export a pdf doc to Microsoft Word format. I could use the Tools > Export PDF method, but am looking to automate the process with a button. Thanks.
Copy link to clipboard
Copied
The basic code to do it is this:
this.saveAs({cPath: this.path.replace(".pdf", ".docx"), cConvID: "com.adobe.acrobat.docx"});
However, this code needs to run from a privileged context, which usually means from the Console, an Action or a folder-level trusted function. You can't just add it to a button and have it work when the button is clicked.
Copy link to clipboard
Copied
Thank you. I decided to just use the Tools > Export PDF method as I wasn't sure how to run from privileged context.
Copy link to clipboard
Copied
Hey, thanks for the help, I am trying to run this code via the Javascript Debugger, but when I do I get the error message:
"The specified file could not be written to. It may be in use." however the only application accessing the pdf is Acrobat. Any suggestions?
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more