Copy link to clipboard
Copied
In Acrobat DC's javascript debugger, I can convert pdf file to xml using codes like below.
var myDoc = app.openDoc("/C/Users/EAGLE/Desktop/test.pdf");
myDoc.saveAs("/C/Users/EAGLE/Desktop/test.xml", "com.adobe.acrobat.xml-1-00")
I want to implement this function in external js script for batch of my PDF files. Please tell me how to do this. THX~~~
No, Acrobat is not suited for that kind of automation.
If you want you can place the code outside a function, though. That way it will immediately execute each time you open the application...
Copy link to clipboard
Copied
Do you mean as a part of an Action in Acrobat Pro?
Copy link to clipboard
Copied
If I create a js file on my computer/desktop, how can I invoke the acrobat api in it? like the app.openDoc() and saveAs()?
Copy link to clipboard
Copied
You need to place the code inside a function and then call it. Like this:
In the folder-level script:
function myExportAsXML() {
// Put your code here...
}
In your Action, or from a menu item, or the console, etc.:
myExportAsXML();
Copy link to clipboard
Copied
You mean call it in Acrobat DC? Can I do the conversion without opening Acrobat DC, without its console and action?
Copy link to clipboard
Copied
No, Acrobat is not suited for that kind of automation.
If you want you can place the code outside a function, though. That way it will immediately execute each time you open the application...
Copy link to clipboard
Copied
Thanks very much~!
Copy link to clipboard
Copied
Mmh,
have a look into the AcroSdk and esp. at the JS-Object.
Hth, Reinhard
Find more inspiration, events, and resources on the new Adobe Community
Explore Now