Copy link to clipboard
Copied
Hi I have created a form and set the field colours as per our requirements, however, when I print the form the field colours also print. I have found the following code which works great when I print:
for(var i=0;i<this.numFields;i++)
this.getField(this.getNthFieldName(i)).fillColor = ["T"];
However, this switches off all field colours for all forms that I open from then on which is not ideal. The problem I have is that I can switch the colour back on, but all fields are one colour, but as you can see in the attached document certain fields need to be certain colours, what is the easiest way to reverse the removal of field colours ensuring that the correct colours end up in the correct fields?
Also is there an easier way to set the field colours than what I have done?
Any assistance would be greatly appreciated.
Cheers
Nicole
Copy link to clipboard
Copied
How does it affect other files, where do you use script?
When you want to print, you can run a script from console, or you can add a script to the file document actions 'Document Will Print'.
Once you're done printing, don't save the file or if you need filled in fields, save before printing under a different name so you also have the original file.
Copy link to clipboard
Copied
I placed in the Document JavaScripts and every other form that I opened up after I printed this one all fields were white instead of having the standard bluish/purple background. I then tried the script in the Document Will Print area of Document Actions and it would not work at all.
Copy link to clipboard
Copied
It can not affect other files. There must have been something else you did.
But the bluish/purplish fill color of the fields you see is a setting of the application to highlight fields on the screen. It does not carry over when the file is printed, so there's no need to disable it.
Copy link to clipboard
Copied
Sorry I didn't explain properly. I switched the Highlight Existing Fields off under the Prepare Form area so that I could set the field colours that were needed under each fields Properties and Appearance. This was the only way that I could get the background colour to be the same for everyone that opened the form. But because I have the Highlight Existing Fields off for this form every form that I open also has the Highlight Existing Fields off. Is there a way to set the field colour so that it isn't the standard bluish/purple without switching the Highlight Existing Fields off and so that I can print the form without the background colour for all fields?
Copy link to clipboard
Copied
Not really. What you can do is add a command in your file that re-enables the fields highlighting when it is closed, but while it is opened it will be disabled for all other files opened at the same time.
Copy link to clipboard
Copied
At the event "Document Will Print" save the field object with the color settings in an array. Then change the color of the fields.
At the event "Document Did Print" restore the color of the fields.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now