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

Acess variable from javascript in vb.net?

dkataria
Registered: Jun 13 2008
Posts: 15

Hi All,

How can we access variable from javascript in vb.net?

what i want to do:-

I am using a adobe javascript in which i defined path of file like this:-

pp.filename="\c\abc.pdf";

Now i want to change abc.pdf from my vb.net application.

Please suggest me.

thanks in advance

My Product Information:
Acrobat Standard 8.1.2, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Accessing a simple variable from the JSO object in a VB.Net application is very simple. Take a look in the examples in the IAC documentation.

The PrintParams are not a simple variable. It is unique for each current instance of a document. It should only be used in the context of a print. You can't set it up in one peice of code and then expect it to be the same at another time. If you want to set the name of the file that will be printed to, then you should do this at the same time that the print is done.

First, create a folder level function for doing the print, something like this:

 function DoMyPrint(cFileName){var pp = this.getPrintParams();... Set other parameter ...pp.fileName = cFileName;this.print(pp);}

Then call this function from the JSO in your VB app.

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