Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
1

Making an image become a checkbox

Explorer ,
Oct 23, 2021 Oct 23, 2021

I would like to put two images side by side and give the viewer a choice to which they want. They would choose by clicking either of the images which then becomes a checkbox. It would be perferrable for a the check mark to appear over the image, leaving the image to still be seen.

 

I have not been able to figure this out on my own. Any help is much appreciated.

TOPICS
Create PDFs , How to , PDF forms , Rich media and 3D
9.7K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 23, 2021 Oct 23, 2021

Place the check-boxes on top of the images and set their fill color to Transparent (or No Color).

However, the tick mark itself will still (partially) cover the selected image. Wouldn't it make more sense to place it elsewhere?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 23, 2021 Oct 23, 2021

When I go to properties and to fill color, I cannot find a means to make it transparent. And no, I would rather the check mark to be placed over the image.

 

Is there a Hex Number for transparent?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 23, 2021 Oct 23, 2021

Choose 'No color'.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 23, 2021 Oct 23, 2021

I wish I could, but there is no such option!!!

 

This is why I am asking for help. I have been using Acrobat since Acrobat 3 in 1997. I would have thought something like this would be simple to do. I tried for a couple of hours last night before posting today.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 25, 2021 Oct 25, 2021

I don't use a Mac, but pretty sure that on both Mac and Win that Acrobat has it's own first level color picker that provides a "No Color" option. There is also a "More Colors..." option that then displays the system color picker. 

This must be something from a recent update for the Mac Version.

 

Looks like you'll need to do this from the console window. Here's the code for setting a color fill to Transparent

 

this.getField("CheckBox1").fillColor = ["T"];

 

Run this code in the console window. Replace "CheckBox1" this the name of your checkbox field.

 

You'll find a video tutorial on using the console window here:

https://www.pdfscripting.com/public/Free_Videos.cfm#JSIntro

 

   

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 03, 2021 Nov 03, 2021

Hello Thom,

Right after I posed my question/problem I had to take my Macbook Pro to the Apple Store. I ended up performing a re-install of Mojave after wiping the internal drive and have been installing everything separately, rather than using a quick install of everything via a clone or Time Machine. I just got Adobe's Creative Cloud installed again last night.

 

I have run the code for a couple of the images that I want to be checkboxes as well and the results are white or blue fill in colors. The images are never seen. I am using the correct names for each checkbox.

this.getField("Cheney").fillColor = ["T"];

this.getField("Greene").fillColor = ["T"];

Above is what I was entering. Not sure what I could be doing wrong, but it is my first time using the console.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 03, 2021 Nov 03, 2021

Turn of 'Show border hover color for fields' in preferences -> forms.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 04, 2021 Nov 04, 2021

I have done this now too and still no luck. I have included an screenshot of what I am trying to do. You can see the checkmark over a white field that is covering the image of the person that should be exposed, not covered up by a white, blue or any other color. It must be transparent.

 

I just did not think this could possibly be such a problem to perform.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Nov 04, 2021 Nov 04, 2021

This would make easier if you share file with us.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 04, 2021 Nov 04, 2021

There's the PDF that I am working on.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 04, 2021 Nov 04, 2021

Eecute

  this.getField("Cheney").fillColor = ["T"];  

  this.getField("Greene").fillColor = ["T"];

in the Javascript console of Acrobat.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 04, 2021 Nov 04, 2021

Hi,

 

Are you sure you are on the latest ACrobat, as I have a transparent checkbox in the same dialog as you showed that achieves what you want.

 

BarlaeDC_0-1636037600516.png

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 04, 2021 Nov 04, 2021

I am using the Mojave OSX and the latest version of Acrobat that works with it.

I thought I did execute the scripts. If not, how to do so?

I do not want to change between any colors!!! I just want it to be transparent. This is so crazy. Screenshot included.

 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 04, 2021 Nov 04, 2021

HI,

 

It is just the way JavaScript handles it, so the code that @Bernd Alheit  showed you is how you set a field to be transparent, so in order to make that change you have to alter the color setting.

 

this.getField("Cheney").fillColor = ["T"];

 

(the "T" just means transparent)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 04, 2021 Nov 04, 2021

I do not understand what you are saying?

 

Didn't I already do what I was told to do by @Bernd Alheit ? If not, then what I am supposed to do?

This is so damned crazy! NOTHING SHOULD BE THIS DIFFICULT! This is not 1997 and Acrobat 3, this is 2021 and Acrobat DC or whatever.

 

This is just is not important enough to fight through all of this. I just wanted a playful form to spoof some friends. 

 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 04, 2021 Nov 04, 2021

How have you executed the scripts?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 04, 2021 Nov 04, 2021

I do NOT know!!!! That's what I am asking you!!!! Have I, haven't I? I do not do code. I did what I was told to do. For code, if a single step it left out of the instructions, then it don't happen.

 

How to execute other than with a loaded gun?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 04, 2021 Nov 04, 2021
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 04, 2021 Nov 04, 2021

That almost works! But the image needs to be shown ALL the time, no matter whether it is clicked or not. I just want a check mark to go over the always seen image which is also a checkbox. Thanks for helping.

 

And then I was going to do the same for the images of Gaetz and Kinzinger too.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 04, 2021 Nov 04, 2021

Remove the code added to the fields. You don't need it. You just need them to be transparent.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 04, 2021 Nov 04, 2021

Is this what you want?  

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 04, 2021 Nov 04, 2021

Yes!!! Exactly what I have been hoping to have happen! Thanks.

What did you do that was different than what I did?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 05, 2021 Nov 05, 2021

I gave the two related check boxes the same name. Then put the politician's name as the export value.  Then I set the background and border colors to transparent. I did all this from Field Properties dialog. No scripting necessary. But that's because I have the "No Color" option.  

 

NoColorOption.jpg

 

 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 05, 2021 Nov 05, 2021

Firstly Thom, thanks for figuring this out for me. I knew it could be done.

 

However, this is also very frustrating, because you have the color option. As someone that has had a licensed copy of Acrobat since Arcobat 3 back in April 1997, this makes no sense. IF I were using Acrobat 3 and you were using Acrobat 4, it would be very understandable that my version does not have the option.

 

As I had mentioned earlier I had to reinstall the Mac OSX and then I started to load back in apps, email accounts, contacts and such separately, one at a time. It was only a couple of days ago that I reinstalled the Creative Cloud and it installed all the Adobe apps. Just a few minutes ago I doubled clicked on the PDF that I've been working on and it opened in Preview rather than Acrobat. So I went to "Get Info" to set it so all PDFs open via Acrobat, which it was yesterday. Acrobat was no longer in my Applications folder! Huh?

 

I go to the Creative Cloud and have it install Acrobat. I open the original PDF form I have been working on. Now, finally there is a transparent check box! Go figure! So of course I have to go back to my other Mac, which is where I started this project. It was bought in February 2012 and now running Yosemite. It is using Acrobat version 2017.009.20044.

 

Standing by what I said three paragraphs ago, I am not still using Acrobat 3 and it is not 1997. But 20 years later there still wasn't a transparent option? WTF? The screenshot is from a couple minutes ago, version 2017.

 

Again, thanks for all the help and suggestions!

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines