These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Open web link on button click with variable Query String

ajitdanve
Registered: Jun 3 2010
Posts: 8

Hi,

We are facing issue with opening a web link with passing a variable value as query string parameter. We have added a form button on the pdf page, on click of it we have opened a web page and we want to pass a variable value in the query string. We can not give the hard code value in querystring, as the value keeps on changing.

Please refer to the images below.

[img]http://elearning.aptaracorp.com/Amex/Testing/02.jpg[/img]

[img]http://elearning.aptaracorp.com/Amex/Testing/01.jpg[/img]

here the data will be my variable name, which contains some value. When i execute it, it passes data as a string, i want to pass its value in the query string parameter. How i can do this?

I had found one more way, is to call a function on the form button click, and in that pass the query string parameter as a variable, it works. But the problem in this case i am faceing is, in the app.launchURL command i have to provide a http path, means something like http://www.google.com, then only it works. I have that page on my local (no server), so i want to add the path as onlu page.html

//Reference code, this fun will be called on a button click
function LaunchPage()
{
app.launchURL("http://www.aptara.com/page.html?value="+data+""); //this works
app.launchURL("page.html?value="+data+""); //this dosent works
}

Please do let me know, how i should proceed. To repeat, i want to invoke a page, which is on my local system with a querystring, in which i sud pass a variable value.

Thanks,
Ajit danve
Sr. Developer
Aptara, Pune.

Ajit Danve

My Product Information:
Acrobat Pro Extended 9.3.1, Windows
try67
Online
Expert
Registered: Oct 30 2008
Posts: 2399
To open a local file I think you need to provide the proper, full, URI. Try this:
Open page.html in your browser and copy the URI from the location toolbar. It will probably look something like this:
file:///C:/somefolder/page.html
Then paste that into your script, with whatever parameters you want to add.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

ajitdanve
Registered: Jun 3 2010
Posts: 8
Hi,

I did tried providing the path as you suggested "file:///C:/somefolder/page.html" in the app.launchURL, but it dosent work. It dosent open the PDF file. Can you please re-check and confirm me about.

One more thing i wanted to check is, if at all, the above method works, then i have no idea where the html page will reside on users machine. So, is thr a way to identify the path of the PDF file, like how we do in html is location.href, and using that path i will launch the html page, as my PDF and HTML page will be residing in the same directory.....

Ajit

Ajit Danve

daka630
Expert
Registered: Mar 1 2007
Posts: 1420
Acrobat's "web link" is specifically for URLs to a target file within a web server's "space".
To link to a file on the local machine or to a file in network space use UNC syntax and use 'open file' for the Acrobat link tool.

n.b., While the "file:" scheme is still usable for a URI/URL it is often "turned off" by the web server admin for security reasons.

Be well...

Be well...

ajitdanve
Registered: Jun 3 2010
Posts: 8
Hi,

Can you please lot me know, what exactly you mean by UNC syntax, i havent understood. If possible, can you please give me exact command/code. I have my html page in the same directory as of my PDF file.

Ajit

Ajit Danve