Copy link to clipboard
Copied
Hi all - I'm using Adobe Acrobat Pro. I have a form (not designed by me) that to complete, the user would fill in a number in a text box, and based on the number, certain values on the form would be circled. Example: if 50 were filled in to the text box, certain information on the page would be circled. If 55 were filled in to the text box, other informatikon on the page would be circled. Is there a way to have a hidden circles around each section of information and then have cirtain circles appear based on the number filled in to the text box?
Copy link to clipboard
Copied
If you need to 'circle' around specific info, like part of the text on the page, you can use a text field to do it.
Create a New Text Field:
Name the text field (e.g., "Circle1").
Set Field Properties:
General Tab:
Set the field to Hidden and Read-Only.
Appearance Tab:
Choose your desired border color to act as the "circle".
Set the fill color to "None" (transparent).
Position the Field:
Place the newly created text field over the information you wish to "circle" on the page.
Add Validation script:
Go to the field where you enter numbers.
Under the Validate tab, choose "Run custom validation script" and enter the following code:
this.getField("Circle1").display = (Number(event.value) == 50) ? display.visible : display.hidden;
This script will make the "Circle1" field visible when the entered value is 50. Otherwise, it will remain hidden.
Adding Additional "Circles":
To circle multiple areas based on different conditions:
Create additional text fields (e.g., "Circle2", "Circle3", etc.).
Use the same script but update the field name and condition for each:
this.getField("Circle2").display = (Number(event.value) == 75) ? display.visible : display.hidden;
this.getField("Circle3").display = (Number(event.value) == 100) ? display.visible : display.hidden;
Notes:
Replace 50, 75, and 100 with the specific numbers for which you want each "circle" to appear.
Adjust the size and position of each "circle" (text field) as needed to align with the target text or information on the page.
Copy link to clipboard
Copied
Yes, in fact, JS code can create circles. However, this type of action will only work in compliant PDF viewers. It won't work in a browser or mobile device.
Use the regular Markup annotations to make the circle.
The annotations all have a "hidden" property that can be set from a script.
https://opensource.adobe.com/dc-acrobat-sdk-docs/library/jsapiref/JS_API_AcroJS.html#hidden
To get the annot you'll need to do one of two things. Write code to search the annots on a page for the one you want, or name the annot. There is no UI for setting an annotation name, it has to be done from the console window.
Copy link to clipboard
Copied
Another option is to use a radio button field as the circle. Make the fill transparent and set ReadOnly to true, so it's just a graphic.
Copy link to clipboard
Copied
This article walks you through it in the Circle-The-Answer Theme section:
https://pdfautomationstation.substack.com/p/coverting-disobliging-pdfs-into-fillable
Copy link to clipboard
Copied
If you need to 'circle' around specific info, like part of the text on the page, you can use a text field to do it.
Create a New Text Field:
Name the text field (e.g., "Circle1").
Set Field Properties:
General Tab:
Set the field to Hidden and Read-Only.
Appearance Tab:
Choose your desired border color to act as the "circle".
Set the fill color to "None" (transparent).
Position the Field:
Place the newly created text field over the information you wish to "circle" on the page.
Add Validation script:
Go to the field where you enter numbers.
Under the Validate tab, choose "Run custom validation script" and enter the following code:
this.getField("Circle1").display = (Number(event.value) == 50) ? display.visible : display.hidden;
This script will make the "Circle1" field visible when the entered value is 50. Otherwise, it will remain hidden.
Adding Additional "Circles":
To circle multiple areas based on different conditions:
Create additional text fields (e.g., "Circle2", "Circle3", etc.).
Use the same script but update the field name and condition for each:
this.getField("Circle2").display = (Number(event.value) == 75) ? display.visible : display.hidden;
this.getField("Circle3").display = (Number(event.value) == 100) ? display.visible : display.hidden;
Notes:
Replace 50, 75, and 100 with the specific numbers for which you want each "circle" to appear.
Adjust the size and position of each "circle" (text field) as needed to align with the target text or information on the page.
Copy link to clipboard
Copied
This worked perfectly, thank you!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now