Strike Through Text When an Acrobat Checkbox Is Checked
Question details
Show strikethrough formatting on PDF text when a checkbox is selected and remove it when the checkbox is cleared.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- A PDF form needs to visually cross out text based on the state of a checkbox.
- Observed behavior
- The desired result is a strikethrough that appears when the checkbox is checked and disappears when it is cleared.
Open the PDF in Acrobat and identify whether the text is page content, a form field, a comment, or part of an image. Make sure you can edit the form and that JavaScript and automatic form calculations are enabled.
Use a calculated form field to overlay a strikethrough
Use this approach when a visual line over the text is sufficient and the PDF will be opened in a viewer that supports Acrobat form JavaScript.
Acrobat form text fields do not provide a simple JavaScript strikethrough font property. This workaround displays a separate line over the text; it does not change the underlying text formatting.
Open All tools > Prepare a form, select the checkbox, and open its Properties. On the General tab, name it Done.
In Prepare a form, add a text field over the text you want to cross out. Name it StrikeLine, mark it read-only, and set its fill and border colors to transparent. Position and size it so its text runs through the middle of the original text.
Open the StrikeLine field's Properties, select Calculate, and choose Custom calculation script. Click Edit and enter: event.value = this.getField('Done').valueAsString !== 'Off' ? '——————' : '';
Close form editing and click the checkbox to test both states. Return to Prepare a form to adjust the line field's position, font size, or number of dash characters until it spans the text.

Work with documents and PDFs in WPS Office
WPS Office is a free, lightweight alternative with a familiar interface and support for common Microsoft Office formats, making it easy to move existing files into your workflow. For the checkbox-driven Acrobat JavaScript solution above, continue using a compatible PDF viewer.

Frequently Asked Questions
Does the calculated line actually format the original text?
No. The StrikeLine text field overlays dash characters on the original text. Clearing the checkbox empties the field, revealing the unchanged text underneath.
Why does the line not appear when I check the box?
Confirm that the checkbox is named Done and that the script is in StrikeLine Properties > Calculate > Custom calculation script. Also check that JavaScript and automatic form calculations are enabled in Acrobat.
Can I use this over static PDF text or an image?
Yes, the overlay can be positioned over either, provided the PDF allows form editing. It only creates a visual line and does not modify the underlying page content or image.
Will the checkbox script work in a browser PDF viewer?
Not necessarily. Some viewers do not support Acrobat form JavaScript or calculations. Test the completed form in the PDF viewer your recipients will use.




