Announcement

Collapse
No announcement yet.

JavaScript works in Foxit but not in Adobe Reader - Foxit PDF Editor for Mac

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Resolved JavaScript works in Foxit but not in Adobe Reader - Foxit PDF Editor for Mac

    Hi,

    I have written a few scripts to automate dates and checking if required fields have been filled when someone clicks to sign the PDF and they work fine on Foxit PDF Editor for Mac on my Macbook M1 Pro and they work when I switch to Parallels Windows and run Foxit PDF Editor Pro. But, when I use Adobe Reader on either OS the JS does not work. I have attached my pdf for reference.
    Attached Files

  • #2
    cwb162

    I've reported the mentioned issue to our JS engineer for further advise. Also, would you please reporting this issue to Adobe support as well to see where the problem could be and check if there's any setting that prevents the JS from runing in Adobe?

    Thank you.

    Comment


    • #3
      The bug is in your scripts.


      When I open your document with Acrobat Reader the JavaScript Console show this message:
      Code:
      SyntaxError: missing ; before statement
      2:Document-Level:Dates

      And when I click in the Date field the JavaScript Console show this message:
      Code:
      ReferenceError: Dates is not defined
      1:Field:Mouse Down

      I did not go further, there may be other errors...
      Last edited by JRB; 02-21-2022, 09:11 AM.

      Comment


      • #4
        Originally posted by cherry View Post
        cwb162

        I've reported the mentioned issue to our JS engineer for further advise. Also, would you please reporting this issue to Adobe support as well to see where the problem could be and check if there's any setting that prevents the JS from runing in Adobe?

        Thank you.
        Okay, thanks cherry. I will send something to them.

        UPDATE: Here is the link to the community.adobe.com post I submitted... https://community.adobe.com/t5/acrob.../td-p/12767795
        Last edited by cwb162; 02-21-2022, 09:55 PM.

        Comment


        • #5
          Originally posted by JRB View Post
          The bug is in your scripts.


          When I open your document with Acrobat Reader the JavaScript Console show this message:
          Code:
          SyntaxError: missing ; before statement
          2:Document-Level:Dates

          And when I click in the Date field the JavaScript Console show this message:
          Code:
          ReferenceError: Dates is not defined
          1:Field:Mouse Down

          I did not go further, there may be other errors...
          I changed a few settings and I see this now in Adobe. I cannot find where the error is and Foxit does not give me the same warning...

          Comment


          • #6
            Date: I cannot understand your script, I changed it for a simpliest one.

            Required: I replaced all "let" by "var".



            Now it works fine.
            Attached Files

            Comment


            • #7
              JRB

              Thank you for your sharing.

              cwb162

              Can you give it a try to see if it helps?

              Comment


              • #8
                That did the trick! Here's a quote from an Adobe community member:

                Test Screen Name
                LEGEND ,
                Feb 21, 2022

                Your script uses clever ECMAscript 6 code tricks including let and interpolated expressions in back tick string literals. But Acrobat doesn't use such a recent language base. Stick to the traditional basics.
                So, do not use "let" or "const," only "var," and do not use string backticks (``) as in JS6.

                Comment

                Working...
                X