2 Replies Latest reply on Mar 1, 2017 1:41 PM by Clouseau3513

    Custom Date Received Stamp

    Clouseau3513

      I have created a custom date received stamp that asks for the date from the user. If the user leaves it blank it defaults to the current date. This stamp works perfect in Acrobat 11 but when i put the stamp in Adobe ReaderDC it works as long as you enter a date but returns a blank line if the user leaves the prompt empty rather than return the current date. Here is the code I used.

       

      var cAsk = "Enter Date Received - Leave Blank For Current Date";
      var cTitle = "Date Stamp Date";

      if(event.source.forReal &&
         (event.source.stampName == "#xM1uT4oWyH3DQs6bmmc9CC"))

      {
         var cMsg = app.response(cAsk, cTitle);
         event.value = cMsg;
         event.source.source.info.DocumentState = cMsg;
      }
      if (event.value=="") event.value = (new Date()).toString();

       

      Anyone have any suggestions to make this work in ReaderDC?

       

      Mike

        • 1. Re: Custom Date Received Stamp
          Karl Heinz Kremer Adobe Community Professional

          I assume you are getting an error on the JavaScript console when you run this in Reader. You would have to enable the JS console in Reader's preferences and select to "Show console on errors and messages".

           

          This line is the culprit:

          event.source.source.info.DocumentState = cMsg;
          

           

          Reader cannot write to any of the properties in the Doc.info object: Acrobat DC SDK Documentation

           

          You could wrap this line into a try/catch block so that execution of your script would continue after this exception.

          • 2. Re: Custom Date Received Stamp
            Clouseau3513 Level 1

            I did go into the javascript preferences in Reader and checked the box for "Show console on errors and messages" and sure enough the error line appeared when I repasted the stamp. I eliminated the culprit line and that took care of it, stamp works great. Thank you so much.

             

            Mike W.