Conditional Formatting Help

New Here ,
Feb 28, 2020 Feb 28, 2020

Copy link to clipboard

Copied

Hi All,

 

I have a client who wants the field to be "bold" if a particular answer is selected from a combo box. I have been doing some reading around writing a script but I'm not super familar with this part of Acrobat.  Would this go into the javascript piece or formatting script.

 

I create PDF forms but use a custom cloud based form software to collect the data and then it maps it over to the PDF and the user can print this out.  Will any conditional formatting even work in this case?  You don't have any of the mouse actions to trigger anything.

 

Any help/direction would be great! Thanks!

 

 

TOPICS
Acrobat SDK and JavaScript, Create PDFs

Views

161

Likes

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
Adobe Community Professional ,
Feb 28, 2020 Feb 28, 2020

Copy link to clipboard

Copied

If your software doesn't support the actions associated with the fields it's not likely to work.

Likes

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
Adobe Community Professional ,
Feb 28, 2020 Feb 28, 2020

Copy link to clipboard

Copied

Formatting via JavaScript will only work if the form is opened in Acrobat/Reader when the field value changes. An script that would do this for a dropdown could be the following custom Validate script:

 

 

// Custom Validate script for dropdown
event.target.textFont = event.value === "Value for Bold" ? font.HelvB : font.Helv;

 

Where "Value for Bold" is the field value when the field should be bold. You'd have to adjust for the actual value you want to use as well as the font.

 

If you're setting the field values some way other than importing the field data using Acrobat, then this sort of JavaScript approach won't work.

Likes

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
New Here ,
Feb 28, 2020 Feb 28, 2020

Copy link to clipboard

Copied

LATEST

Thank you for both of your replies, its much appreciated.  I figured it wouldn't work but I wanted to confirm before excluding this solution.

 

Thanks again for the helpful and quick responses.

Likes

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