Hi,
Adobe Livecycle ES2 V9
Here's the code I'm currently using (postSave):
var fileName = event.target.documentFileName;
// at this point, fileName is (myForm.pdf), there's no file path
fileName = fileName.substring(0, fileName.indexOf("."));
xfa.host.exportData("./" + fileName + ".xml", 0);
Basically, when the user saves the PDF an XML file is automatically saved in the same directory with the same name as the PDF.
The problem is event.target.documentFileName only gets the pdf and extension (ex: site_checklist.pdf)
If the client opens two or more PDFs, it tries to export the XML into the directory of the first opened PDF (or the last, haven't narrowed it down).
How can I get the filepath of the current PDF (not the most recently opened PDF)?
I can't find any documentation for .documentFileName, I've tried documentFilePath too.
Solved! Go to Solution.
Views
Replies
Total Likes
The property you're looking for is the "path" property: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.411.html
Here's the documentation for documentFileName: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.389.html
Views
Replies
Total Likes
The property you're looking for is the "path" property: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.411.html
Here's the documentation for documentFileName: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.389.html
Views
Replies
Total Likes
The path is resolved with:
It includes the file name too, so if you have to remove it if neccessary with:
Thanks guys, I'll see if this resolves the problem.
EDIT: Seems to have fixed the problem.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies