Copy link to clipboard
Copied
What I want to do is create a form that is fillable from a Delimited text file. I already have all of that set up and working. I however want to make it simpler for my colleagues who aren't as savvy by allowing them to click a button embedded in the PDF that will automatically point to the delimited file and just launch the "import data from delimited text file" box so that they can just choose what they need. I am not great with writing javascript, does anyone have a basic idea if this is doable and what script would be needed to call the file?
Thanks in advance.
Copy link to clipboard
Copied
If you want to specify the file path in the script it has to run from a "privileged context", ie a .js file that's installed on the user's local machine.
Copy link to clipboard
Copied
Is there any alternative to this? we are at a university and I don’t think we have access to the folders where the .js file would have to be installed. (If you could confirm the folders I can check)
Copy link to clipboard
Copied
Not without a lot of effort. You can use a button to open the file selection dialog, and then the row selection dialog, though.
Copy link to clipboard
Copied
How would this be done?
Copy link to clipboard
Copied
Using this code:
this.importTextData();
Copy link to clipboard
Copied
Does anything go inside the parenthesis? And is this in the buttons JavaScript section or the JavaScript section for the file itself?
Copy link to clipboard
Copied
In this case, no. Use it as I provided it.
And it should go as the Mouse Up event of your button.
Copy link to clipboard
Copied
Yes, but what you are asking about is creating an Automation tool, not a form feature. As Try67 has already stated, this type of activity requires privilege.
You can read more about automation and data handling here:
Automating Acrobat can save you loads of time.
https://www.pdfscripting.com/public/ExcelAndAcrobat.cfm
The last tool listed on this page displays a popup menu of options from a CSV (comma separated), for auto-filling fields on a form, which sounds a lot like what you need.