Expand my Community achievements bar.

PrePrint Event to prevent printing of Background Fill

Avatar

Level 10
Hi,



I have a dynamic form, with a group of three radio buttons. Depending on the User's choice of this group of buttons, a different hidden Subform appears.



To make it easier for the User, each hidden subform has a different colour (Red / Amber / Green).



I want to save ink when the User is printing and I am trying to set up a PrePrint event to revert the background to white or blank and then a PostPrint event to revert to the original colour after printing.



Each hidden subform has a colour border on one side which I want to keep in the printed version.



Any help gratefully received.



Thanks,



Niall
2 Replies

Avatar

Former Community Member
You should be able to achieve this simply by specifying a little bit of script for each of the subform's prePrint and postPrint events in the Script Editor.



In each subform's prePrint event, use the following FormCalc script:



$.fillColor = "255,255,255";


This will set each subform's fill (background) color to white when the user chooses the print the form.



Then set each subform's postPrint event to the following FormCalc script:



$.fillColor = "255,255,0";


This will set the subform's fill (background) color to yellow. Use the RGB values for red (255,0,0) and green (0,255,0) for their respective subforms.



I've attached a sample form which contains a subform with a yellow background color. When you press the print button, the subform's background color is changed to white. When the print dialog is dismissed (with either OK or Cancel), the subform's background color is restored to its original yellow.



Stefan

Adobe Systems

Avatar

Level 10
Thanks Stefan, worked perfectly.



Regards,



Niall