PDF Editing Issues

Strike Through Text When an Acrobat Checkbox Is Checked

Aamir Naveed AkramAamir Naveed Akram Nov 19, 2026 870 views

Question details

Show strikethrough formatting on PDF text when a checkbox is selected and remove it when the checkbox is cleared.

Strike Through Text When an Acrobat Checkbox Is Checked
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.
Before you start

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.

Solution 1Recommended

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.

1
Name the checkbox

Open All tools > Prepare a form, select the checkbox, and open its Properties. On the General tab, name it Done.

2
Add a line field

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.

3
Add the calculation

Open the StrikeLine field's Properties, select Calculate, and choose Custom calculation script. Click Edit and enter: event.value = this.getField('Done').valueAsString !== 'Off' ? '——————' : '';

4
Adjust and test the line

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.

Use a calculated form field to overlay a strikethrough
Viewer support matters: The line depends on form calculations and JavaScript. Some browser PDF viewers and other PDF apps may not run the script. If it does not update in Acrobat, check Preferences > Forms for the automatic calculation setting.
Free Microsoft Office alternative

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.

Open and work with PDFs alongside office documentsCompatible with Microsoft Word, Excel, and PowerPoint formatsFamiliar interface for a smooth transition from Microsoft OfficeFree and lightweight for everyday document work
microsoft office alternative - wps office

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.