Do you have a link to any other source too? Not much info here...
Thank you for the links provided, but I still have some troubles with making this work.
This is the code I wrote:
var f = this.getField("btnImage"); // button field
if (f.buttonImportIcon("/C/image.pdf") == 0) // if 0 == no error
Do I have to use buttonSetIcon() first? Or define the path to an image elsewhere?
1 person found this helpful
From the documentation of buttonImportIcon:
Note: (Acrobat 8.0) If cPath is specified, this method can only be executed during batch and console
events. See Privileged versus non-privileged context for details. The event object contains a
Thanks, I'll look into it.
I apologize if this is a dumb question, but I just started using acrobat few days ago..
Is this sentence: "...this method can only be executed during batch and console..." equivalent to doing this:
- Tools -->
- Action Wizard -->
- New Action -->
- More Tools -- >
- Specify Settings -->
- *entering js code* + save action -->
- running action from the Actions List
It's not a dumb question at all, actually. And yes, I believe it should work from the context of an Action (as it is considered privileged), but try it out and let us know.
Did you actually set the button's Layout to "Icon Only"?
What layout do you use in the properties of the button?
Yeah I forgot to set it to Icon only.. that did it! Thank you
Please can you explain to me how you achieved the final result.
I have it so that I can browse for an image through the button import but I want to be able to open a PDF and it automatically populate a field with an image of a specific name.
I think what you have done here would work but I'm not exactly sure where to place your code to test it.
If you or someone else can explain it to me I would be very grateful.