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

How to Switch Field Colors to Transparent When Printing (and Back Again)?

New Here ,
Jul 19, 2021 Jul 19, 2021

Copy link to clipboard

Copied

I'm building a multi-page form in Acrobat DC that has fields with multiple colors based on manual inputs, calculated totals, locked fields, pre-entered text and #s, etc. 

 

I need to find a way to make all the field colors transparent only when the document is printed. I've tried to use the following code in the "Will Print" document action, but it doesn't work with all the fields and it also doesn't bring back the field colors after printing.

for(var i=0;i<this.numFields;i++)
     this.getField(this.getNthFieldName(i)).fillColor = ["T"];

Your help is VERY VERY VERY much appreciated and I'm grateful to you for your time.

Thanks in advance,

-Jonathan

TOPICS
How to , JavaScript , PDF forms , Print and prepress

Views

223

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 ,
Jul 19, 2021 Jul 19, 2021

Copy link to clipboard

Copied

LATEST

It should work with all the fields... Which fields is it not working with, exactly?

 

To change it back you need to use the Did Print event, and change your code to apply back the original fill color.

If this color is not the same for all fields then it becomes more complicated, as you'll need to save that color into a variable (probably an array is the best option) in the Will Print event, and then apply it back in the Did Print event.

If it is the same color (probably white) then you can use the same code, adjusting the last part of it accordingly.

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