Copy link to clipboard
Copied
I am updating a company form that was originally created in Livecycle Designer, by a user who has left the company, which had an attach image button. The company purchased acrobat pro dc for me, thinking that I would be able to update the form, however it is not able to be edited and so I re-created the form in pro dc.
I can have the user insert a PDF image using the javascript
event.target.buttonImportIcon();
However not being a javascript familiar, and still learning acrobat, this is as far as I can get in the previous forums before I get lost.
The javascript works fine to get the image, however doesn't clear once the reset form or submit form buttons are used.
Can anyone please give me simple and clear instructions on how to do this?
P.S. Adobe website does not mention anything about not being able to edit livecycle designer forms in other versions of acrobat, so I am already very frustrated. Therefore please make replies newby friendly.
You can't clear it directly. What you can do is a kind of a hack, which is to copy the icon of a button that has no icon applied to it.
So you create an image button (it can be hidden), set it to have an icon, but then don't actually select one.
When you want to reset your other button you can use this code:
this.getField("Image1").buttonSetIcon(this.getField("EmptyImage").buttonGetIcon());
Copy link to clipboard
Copied
You can't clear it directly. What you can do is a kind of a hack, which is to copy the icon of a button that has no icon applied to it.
So you create an image button (it can be hidden), set it to have an icon, but then don't actually select one.
When you want to reset your other button you can use this code:
this.getField("Image1").buttonSetIcon(this.getField("EmptyImage").buttonGetIcon());
Copy link to clipboard
Copied
Thankyou try67, but I'm still a little confused, sorry.
I create my button "image1" which I set to run the javascript; event.target.buttonImportIcon();
Do I then need to create a "EmptyImage" button which is hidden, and then I need my "ResetForm" button to run the javascript you suggest?
If it is something different to this, can you please step me through it, as this doesn't work.
Copy link to clipboard
Copied
Yes, that's pretty much it.
On Wed, Oct 5, 2016 at 11:50 PM, warrick_lee <forums_noreply@adobe.com>
Copy link to clipboard
Copied
Ok, I am obviously missing something then, because I can't get it to work.
I've got my get image button "Image1" which is set to icon only, action mouse up, run a javascript - event.target.buttonImportIcon();
I've created a hidden button "EmptyImage", which is set to icon only, Behavior none, no label, or icon, no actions
I've create my reset form button "reset", which is set to label only, action mouse up, reset a form and run a javascript - this.getField("Image1").buttonSetIcon(this.getField("EmptyImage").buttonGetIcon());
However this doesn't work for me, what am I missing?
Thanks in advance
Copy link to clipboard
Copied
It's working fine for me... Are there any error messages in the JS Console when you run this code?
Can you share the file in question (via Dropbox, Google Drive, etc.)?
Copy link to clipboard
Copied
Dropbox - 8441910 Iss6 - UltraQ_UQReflex PAF_v4.pdf
There isn't any errors.
I'm testing the form using Reader DC
Copy link to clipboard
Copied
There is an error for me and it indicates that you have the field name wrong. The name of the button is "Image 1", not "Image1".
Copy link to clipboard
Copied
Thanks George, and thanks Try67. Can't believe I missed that typo.
Thanks so much for your help.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now