1 Reply Latest reply: Aug 1, 2012 12:05 PM by George_Johnson RSS

    Validate a link

    _S_KEMP_ Community Member

      Hi,

       

      I have a button in a PDF that links to an HTML file online. It possible to validate the link and if not valid (ie file doesn't exist), change the link to something else?

       

      currenlty I have:

       

      //-------------------------------------------------------------
      //-----------------Do not edit the XML tags--------------------
      //-------------------------------------------------------------

      //<AcroForm>
      //<ACRO_source>Button1:Annot1:MouseUp:Action1</ACRO_source>
      //<ACRO_script>
      /*********** belongs to: AcroForm:Button1:Annot1:MouseUp:Action1 ***********/
      fixed = "http://mywebsite.co.uk/";
      filename = this.documentFileName;
      urn = this.documentFileName.split(".").shift();
      folder = urn+"/";
      page = urn+".html";
      url = fixed+folder+page;
      app.launchURL(url);


      //</ACRO_script>
      //</AcroForm>

       

      If the url is not valid, then app.launch(url) tries a different url.

       

       

      Thanks.