3 Replies Latest reply on Feb 19, 2008 1:02 PM by Patrick Leckey

    NotAllowedError - Reader 8 vs 7 inconsistency

      This is the loose transcription of a message already posted at the Planetpdf Forum. There became evident to me, that there are serious errors in the JS documentation, and there are also unpredicted changes in the JS behavior, so I really don't know whether it is worthwhile to invest in such an unreliable stuff anymore.

      I have a problem with a PDF, which I authored in Acrobat 7.0 Professional (WinXp). The PDF uses JavaScript to achieve some graphical effects. The problem is, it works just fine when viewed in Adobe Reader 7, but no longer works in Reader 8.

      This weird behavior is due to some apparently new Security Settings within Adobe Reader 8:
      Reader8 will refuse to set the .rect property for a ScreenAnnotation.

      There is a sample PDF for download at Planetpdf:

      If you enable the "Show console" functionality within Reader8, you will see that the following error is thrown:

      NotAllowedError: Security settings prevent access to this property or method.
      ScreenAnnot.rect:5:Screen theScreenAnnot:Mouse Up

      These are my findings so far:
      - the ScreenAnnot.rect documentation in the "JavaScript for Acrobat API Reference 8.1" does not make any reference to any rights or security-related issues.
      - according to my experiments so far, the problem is NOT related to the Document Restrictions settings, but who knows..

      Currently, it seems to me that I have no other option than rewriting my huge JS code and use Fields instead of ScreenAnnots. That would mean a lot of work, but I'll have to put aside some quite important features as well, which Fields simply don't provide.

      I don't think there are any workarounds, but if you know one, please let me know.

      Thanks for your time.
        • 1. Re: NotAllowedError - Reader 8 vs 7 inconsistency
          Patrick Leckey Level 3
          Actually the JS API Reference for ScreenAnnot.rect does say it is restricted. If you'll notice the "D" in column 2 of the quickbar and then read what that "D" means, this is what the documentation says:

          Writing to this property or method dirties (modifies) the PDF document. If the document is subsequently saved, the effects of this method are saved as well. (In Adobe Reader, the document requires specific rights to be saved.)

          So if the document does not have save rights, Reader will not be able to modify the property. I am getting this from the JavaScript for Acrobat API Reference Version 8.1 (April 2007).
          • 2. Re: NotAllowedError - Reader 8 vs 7 inconsistency
            Level 1
            Dear PDL,

            We are using the same documentation.

            I do not intend to save the PDF. I just want to achieve some graphical effects. And that worked in Reader 7.

            By the way, the Field.rect property, for instance, has not only a "D" sign in column 2 , but also a "F" sign in column 4 (sic!). ("F" is a new addition as compared to the JS API v7). But it still works in Reader 8 without any forms rights!!!

            So that's why I am angry, if you see what I mean
            • 3. Re: NotAllowedError - Reader 8 vs 7 inconsistency
              Patrick Leckey Level 3
              Hmmm... you're right. Given your example PDF you should not be getting that error. This should be logged as a bug, just hard to say if it is a bug with the API or a bug in the documentation.