to prevent user from printing you can use the validate element in the config DOM.
Here's an article which descibes how to use it.
I don't want to restrict printing by the user unless the fields are filled, I want the subforms that have unfilled fields to not print on the document. I probably didn't explain it well.
Let me try again.... I have a form with a visible subform with fill in fields and there is a checkbox in front of the first field. If that checkbox isn't checked and the fields are empty, I don't want that subform to print. Does that make sense?
I use a function like the one below to test for a subform containing empty fields, so you could pass in the subform and if you get a true response set the presence property of the subform to "hidden".
var result = true;
result = node.isNull;
for (var i=0; i<node.nodes.length && result; i++)
var childNode = node.nodes.item(i);
if (childNode.isContainer && childNode.className !== "draw" && childNode.className !== "variables")
result = isNull(childNode);
Depending on how complicated your subform is it might just be simplier to test the fields individually.
Europe, Middle East and Africa