Announcement

Collapse
No announcement yet.

JavaScript Upon Opening PDF

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

  • JavaScript Upon Opening PDF

    I want a popup:
    app.alert("Whatever text here");
    to initiate once when I first open the PDF.

  • #2
    jrevet Can you please elaberate a bit on your request? then I can search it from our database. It would be helpful if you can provide sample file for reference. Thanks.
    Also, you can provide all info to us via ticket center: https://www.foxit.com/support/ticket.html

    Comment


    • #3
      Try this, of course it requires a (hidden) field named "counter" in the document :

      if (this.getField("counter").value == 0) {
      app.alert("Whatever text here");
      this.getField("counter").value += 1;
      }


      Assign zero as default value in the "counter" field, and don't forget to reset it before sending the doucment.
      Last edited by JRB; 12-08-2021, 10:23 AM.

      Comment


      • #4
        amanda_liang
        JRB

        It isn't working. It works when I change a field value, but does not alert right when the document is open.

        I made a little example of what I am looking for with more detail.

        Attached Files

        Comment


        • #5
          Sorry, I forgot to specify that it's a document level script, not a Calculation script.
          Try it in the attachment, I added the condition for the AVAIL field.

          if (this.getField("COUNTER").value == 0 && this.getField("AVAIL").value != "") {
          app.alert("COUNTER value is 0 and AVAIL is not empty");
          this.getField("COUNTER").value += 1;
          }
          Attached Files

          Comment


          • #6
            Thank you JRB, you are the export in scripting.

            Comment


            • #7
              Thank you.
              Yes, I'm an exported expert!
              :-)

              Comment

              Working...
              X