3 Replies Latest reply on Feb 21, 2008 1:22 PM by Bernd Alheit

    JavsScript test for Usage Rights

      I have several forms that include a submitForm()/ mailDoc() routine which sends a PDF or FDF (depending if using Reader or Acrobat). If the viewer is Reader then I send the data as an FDF as Reader cannot send PDF forms as attachments.

      Here is my current script:

      if(app.viewerType == "Reader"){
      var url = "mailto:"+this.getField("Address").value;
      this.submitForm(url,true);
      }else{
      /* This will send out the mail with the attached PDF file */
      var dsubject = this.getField("Subject");
      var dmessage = this.getField("Message");
      var daddress = this.getField("Address");
      this.mailDoc(true, daddress.value, "", "", dsubject.value, dmessage.value);
      }

      Now that Usage Rights are available, I would like to enable Reader to attach PDF files as email attachments.

      Is there a JavaScript function that will test to see if Usage Rights have been enabled for the curent form if opened in Reader?

      The issue is that if Reader has Usage Rights enabled I would like to attach a PDF to the email. If Usage Rights are not enabled I will attach the data as an FDF file. I am looking for something like the following:

      if((app.viewerType == "Reader" && UsageRights == "Enabled") || app.viewerType != "Reader") {
      attach PDF
      }else {
      attach FDF
      }

      Thanks in advance.