How to both hide and not print a field

How can I create a “Hide” button that will both hide a field from view and make it non-printable.

Using:
elements.field_name.visible=false;

will hide the field, but it still prints. I have tried to assign the field a text color of white, but am having syntax problems with that. Perhaps there is a better way.

Is there written documentation showing how to change the properties of form elements using methods? The “Buttons” solution gives some good examples, but I was wondering if more examples are available.

this is a know limitation of printing.
You don’t print the current screen but a new screen is created with the default properties/look.
We will try to change that in a further release.