Copy link to clipboard
Copied
I need help (I don't have a clue) with a java script to program a button to retreive an image from a users database and insert into a form field. Basically to go to the Select Icon menu.
[edited by moderator - there was no body to the post and it was all in one long title header. Shortened the title and pasted the original, full length title as the body to the post]
OK, that's quite easily done. As the button's MouseUp event, select "Execute JavaScript" and then enter this code:
event.target.buttonImportIcon();
When you then click the button it will open a file selection dialog, and the selected file will be displayed as the button's icon.
Copy link to clipboard
Copied
You can only do that if the script is installed on the user's local machine. And of course, you need to know the full path of the image file.
Otherwise, the used will need to select it manually.
Copy link to clipboard
Copied
That's correct. The intent is for the user to manually select the image file from their computer data base. I just want the button to re-direct to the button/properties/choose icon/ select icon menu.
Thank you.
Copy link to clipboard
Copied
OK, that's quite easily done. As the button's MouseUp event, select "Execute JavaScript" and then enter this code:
event.target.buttonImportIcon();
When you then click the button it will open a file selection dialog, and the selected file will be displayed as the button's icon.
Copy link to clipboard
Copied
Perfect. Thank you very much!
Copy link to clipboard
Copied
Two thoughts.
1. We were a bit confused because "data base" means something other than "the files on the user's computer".
2. Note that if your JavaScript is to run in Reader the image must ALREADY be a PDF, it cannot be a JPEG or whatever.
3. If developing for Reader be sure to test on a computer with ONLY Reader, and look at the JavaScript reference to check the Quick Bar for each method used, because many are not in Reader.
Copy link to clipboard
Copied
2. Note that if your JavaScript is to run in Reader the image must ALREADY be a PDF, it cannot be a JPEG or whatever.
+ + +
Find more inspiration, events, and resources on the new Adobe Community
Explore Now