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

Sending values to a livecycle form from an aspx page

norminator
Registered: Aug 11 2009
Posts: 11

Good Day guys,

I am a new livecycle developer...currently i am working on a project that requires the use of livecycle forms. Now the problem is I have a web application that I have created using ASP.net. Now there is a certain page which is used to call different livecycle forms. Now if the user clicks to open a form I would want a session variable to be passed to the pdf form; this value is used to conduct necessary calculations located on the form. My question is how do you pass values from a aspx page to a livecycle form? Whats the code used?

Thanks in advance.

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
There are many ways. It sounds like the user is opening the PDF from a link? and the info you need to pass in is very small? If this is true then there is an easy way. Pass the info in the link URL as a query string.

In the Acrobat JavaScript environment the full URL that was used to open the file is available in the "this.URL" property. You'll need to write code to parse out the session variable. It's best to do this after Acrobat has loaded and initialized the document. There are several events like "Doc Ready" or the "Initialize" event for the top level subform that will work.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

norminator
Registered: Aug 11 2009
Posts: 11
This is the code used in my web application (vb) to call the pdf located in the project file:

Start("New Form 1 a.pdf")

This code opens the pdf not in the web browser but in the acrobat stand alone environment.
Where whould I put the Query string?
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Where does this PDF live? Is is on a web server?

You say this is an ASPX application? So it's a web page?

When the PDF opens in Acrobat do this. Open the Acrobat Console Window and run this code:

this.URL;

What's returned?

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

norminator
Registered: Aug 11 2009
Posts: 11
when i display this.url; undefined was returned, currently testing it on my local machine so the pdf is in the project file. And yes it is an aspx application and a web page.
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
JavaScript is case sensitive. Take another look at my post, "URL" is uppercase.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

norminator
Registered: Aug 11 2009
Posts: 11
same result received (undefined) when i displayed this.URL;
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Impossible! Try this code

this.path

If this comes back "Undefined" then you have a context problem, i.e., "this" is not in the context of the document.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

norminator
Registered: Aug 11 2009
Posts: 11
it also comes back undefined...but thats ok I have found a way to expose this variable by creating a webservice...but my new question to you is how do I after creating a connection to this web service on the form call it on any event and pass this value to lets just say a textbox?

Hope I am not being a bother I am pretty new to this development tool.
Thanks much
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
I think that you are running the code from the wrong place. There is no reason to create a web service. Debugging this is done entirely from inside Acrobat Professional. Please watch the video on the Acrobat JavaScript Console Window, the link is in my signature block.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script