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

Changing Check Box Style for entire document

Community Beginner ,
Jun 01, 2021 Jun 01, 2021

Copy link to clipboard

Copied

I have a very large document with check boxes. There are a total of 63 pages and 565 check boxes. When I convert from Microsoft Word to Adobe PDF, then create a form, I have yet to find a way to tell it that I want these check boxes to default as either "Cross" or "Check" (why is "Square" even an option?). Since I can't have it correct off the bat, I need to go and change every single check box from "Square" to "Check." I have found the most efficient way to do this is per page. That still means I need to go to each page, select all check boxes on that page, and change the Check Box Style properties.

 

Please tell me I'm doing it wrong and there is a quicker/easier way to do this.

TOPICS
Create PDFs , Edit and convert PDFs , PDF forms

Views

3.3K

Translate

Translate

Report

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

correct answers 1 Correct answer

Community Expert , Jun 01, 2021 Jun 01, 2021

You need to run this code from javascript console.

Code:

 

for (var i=0; i<this.numFields; i++) {
var fieldt = this.getNthFieldName(i);
if(this.getField(fieldt).type == "checkbox"){
this.getField(fieldt).style = xxx ;}}

 

 Change 'xxx' with style you want.

Styles:

check = style.ch
cross = style.cr
diamond = style.di
circle = style.ci
star = style.st
square = style.sq

Votes

Translate

Translate
Community Expert ,
Jun 01, 2021 Jun 01, 2021

Copy link to clipboard

Copied

You need to run this code from javascript console.

Code:

 

for (var i=0; i<this.numFields; i++) {
var fieldt = this.getNthFieldName(i);
if(this.getField(fieldt).type == "checkbox"){
this.getField(fieldt).style = xxx ;}}

 

 Change 'xxx' with style you want.

Styles:

check = style.ch
cross = style.cr
diamond = style.di
circle = style.ci
star = style.st
square = style.sq

Votes

Translate

Translate

Report

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 Beginner ,
Jun 01, 2021 Jun 01, 2021

Copy link to clipboard

Copied

Thank you!!! I had no idea how to do Java and so this was a first.

I was able to add it into the document, but is there a way to keep it in Adobe so I don't need to do this every time?

Votes

Translate

Translate

Report

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 ,
Jun 01, 2021 Jun 01, 2021

Copy link to clipboard

Copied

No, you can't change the default settings used by the Fields Detection Wizard.

Votes

Translate

Translate

Report

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 ,
Jun 01, 2021 Jun 01, 2021

Copy link to clipboard

Copied

You can do it by running this code from a button or the JS Console:

 

for (var i=0; i<this.numFields; i++) {
	var f = this.getField(this.getNthFieldName(i));
	if (f==null) continue;
	if (f.type=="checkbox") f.style = style.ch;
}

Votes

Translate

Translate

Report

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 Beginner ,
Jun 01, 2021 Jun 01, 2021

Copy link to clipboard

Copied

Thank you so much! 

Votes

Translate

Translate

Report

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 Beginner ,
Jan 12, 2024 Jan 12, 2024

Copy link to clipboard

Copied

LATEST

Just a tip - 

Open javascript console: Ctr + j

Put in your script in the console (bottom), make sure to put in the style you want, ie  style.st

Highlight the script

hit Ctr + enter

Votes

Translate

Translate

Report

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