Skip navigation
Currently Being Moderated

Validate a link

Aug 1, 2012 10:03 AM

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.

 
Replies

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points