Previous Next


                                              752
       CHAPTER 8                                                         Interactive Features



       The RH entry ensures backward-capability for this feature. Some PDF documents
       include JavaScript segments that verify compliance with certain requirements.
       Such JavaScript segments are called requirement handlers. Backward-compatibili-
       ty is achieved by ensuring that either the PDF consumer application checks the
       requirement or the JavaScript segment checks the requirement, but not both.

       When a PDF document is first opened, all JavaScript segments in the document
       are executed, including the requirement handlers. If the PDF consumer applica-
       tion understands the requirement dictionary, it disables execution of the require-
       ment handlers named by the RH entry. If the requirement handler is in JavaScript,
       the PDF consumer application looks up the segment using the Names dictionary
       (Section 3.6.3, “Name Dictionary).

       In PDF 1.7, the only defined requirement type is EnableJavaScripts. This require-
       ment indicates that the document requires JavaScript execution to be enabled in
       the PDF consumer application. If the EnableJavaScripts requirement is present,
       the application can allow the user to choose between keeping JavaScript execu-
       tion disabled or temporarily enabling it to benefit from the full function of the
       document.

       If the EnableJavaScripts requirement is present in a requirement dictionary, the
       inclusion of the RH entry that specifies a JavaScript segment would be pointless.
       Writing a JavaScript segment to verify that JavaScript is enabled would not
       achieve the desired goal. The RH entry is provided to support future capability.


  8.9.1 Requirement Handlers

       A requirement handler is a program that verifies certain requirements are satis-
       fied. Table 8.114 describes the entries in a requirement handler dictionary.

                     TABLE 8.114 Entries in a requirement handler dictionary
KEY                     TYPE         DESCRIPTION

Type                    name         (Optional) The type of PDF object that this dictionary describes. If
                                     present, must be ReqHandler for a requirement handler dictionary.

Previous Next