Presence vs Relevance
Designer 7.1 introduced the ability to specify whether a button was visible only on the (computer) screen, only on paper (print) or both (visible all the time). This feature, supported in conjunction with Acrobat 7.0.5, was then extended to all XFA objects (text fields, check boxes, lists, etc.) in Designer/Acrobat 8.0.
Unfortunately, how the two concepts interact is something that isn’t easy to grasp at first and so I thought I would delve into the details and attempt to clarify things.
Note that in this article when I write about Acrobat I include Reader as well.
Before Relevance
Prior to the concept of relevance, an object was either visible, invisible or hidden, as specified by the presence attribute and it didn’t matter whether the form as being rendered on a computer screen or printed on a piece of paper — it could either be seen or not.
One of the problems with this approach to presence surfaced when you wanted to design a form that had a submit button for the electronic “fill & submit” workflow but you also wanted to support the manual “fill, print & mail” workflow. When the user printed the form, they would get this submit button on the print-out which was completely useless and looked out-of-place.
In Designer/Acrobat 7.0 or earlier, if you wanted to prevent the button from printing, you had to resort to scripting the button’s PrePrint and PostPrint events in order to hide the button while the form was being printed:
PrePrint
this.presence = "invisible"; // or "hidden";
PostPrint
this.presence = "visible";
Relevance in Designer 7.1 / Acrobat 7.0.5 – 7.0.9
The advent of Designer 7.1 and Acrobat 7.0.5 introduced support for “relevance” on button objects only. Relevance lets us further define the circumstances where an object is visible.
There are currently two supported “views” to which objects may be relevant: Screen View and Print View. They are both straight-forward: The Screen View represents the form as it is seen on a computer screen (in Acrobat or a browser) and the Print View represents the form as it is seen on paper (after being printed).
The following table illustrates the view(s) in which a form object is visible given values assigned to an object’s presence and relevant properties. For instance, if an object is defined as follows in XFA
<field presence="invisible" relevant="+print">...</field>
it would be included (“in”) only in the Print View.
Relevant | Presence | Screen View | Print View |
visible | in | in | |
visible | in | out | |
invisible | out | in (visible) | |
invisible | out | out | |
hidden | out | out | |
hidden | out | out |
Note that if the relevant property isn’t specified, the presence property controls the object’s inclusion in both views at the same time (as was the case before the introduction of the “relevant” property).
More importantly, notice how setting the presence property to “invisible” and the relevant property to “+print” actually causes the object to be visible in the Print View (rather than invisible). This wasn’t the original intent and was corrected in Acrobat 8.0+.
Relevance in Designer/Acrobat 8.0+
The 8.0 versions not only added support for presense and relevance on all objects (text fields, list boxes, circles, squares, text, subforms, radio button lists, etc.) but they also corrected the results of some presence and relevant property combinations such that the two are now disjoint: The relevant property determines the view (Screen and/or Print) to which an object belongs and the presence property then controls the object’s visibility within that view.
The result is as follows (note the differences highlighted in blue between both tables):
Relevant | Presence | Screen View | Print View |
visible | out | in | |
visible | in | out | |
invisible | out | in (invisible) | |
invisible | in (invisible) | out | |
hidden | out | in (hidden) | |
hidden | in (hidden) | out |
As in previous versions, the omission of the relevant property gives control to the presence property in both views.
Setting Presence and Relevance in Designer 8.0+
Designer exposes presence and relevance via its presence property in the Object palette. It combines the two into the following settings:
Designer | XFA Relevant | XFA Presence |
Visible | <not specified> | visible |
Visible (Screen Only) | visible | |
Visible (Print Only) | visible | |
Invisible | <not specified> | invisible |
Hidden | <not specified> | hidden |
Differing Behaviors Across Acrobat Versions
Remember that the results of the relevant and presence property combinations are specific to the version of Acrobat being used to view/print the form.
For example, if you designed a form with a button that had
presence="invisible", relevant="+print"
it would be excluded from the Screen View but visible in the Print View in Acrobat 7.0.5 – 7.0.9. However, if you were to open the same PDF form in Acrobat 8.0+, the button would be invisible in the Print View.
Posted by Stefan Cameron on September 27th, 2007
Filed under Acrobat,Designer,XFA