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

How to implement Collab.hashString( Collab.URL2PathFragment()) ??

anoopmohan
Registered: Feb 11 2010
Posts: 13

Hi,

a) How can I use Collab.URL2PathFragment() and Collab.hashString() functions in .NET ?
b) Is there any javascript available for this ? If it is available, from where I can download it ?

HELP PLEASE !!!

Thanks
Anoop

My Product Information:
Acrobat Pro 7.0, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
You can run code in the Acrobat JavaScript Environment from the JSO object in the IAC interface. You find the SDK documentation:

http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp

And you'll find examples in the SDK, which can download here:
http://www.adobe.com/devnet/acrobat/?view=downloads

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

anoopmohan
Registered: Feb 11 2010
Posts: 13
Hi Thomp,


Thanks for your valuable suggestions.
Is it possible to create an IAC interface from .NET ?


Thanks,
Anoop
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Why yes it is. When you add the Acrobat ActiveX object as a reference to a Visual Studio .NET project it will automatically create a proxy object. Give it a try. There are samples in the Acrobat SDK.

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

anoopmohan
Registered: Feb 11 2010
Posts: 13
Hi Thomp,

Thanks for your reply.

I downloaded Acrobat 8 SDK. I could not see anything about collab.URL2PathFragment() and collab.hashString() functions in Acrobat SDK sample applications. I created an IAC in C# by adding Interop.Acrobat.dll in reference. I created an CAcroPDDoc object as pdDoc. Then I created a JSO object using pdDoc.GetJSObject() method. But after that how can I call the collab.hashString() function from this JSO ? Could you please correct me, if I am going in wrong way ?

Expecting your valuable suggestions.

Thanks
Anoop
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
From the JSO you have direct access into the Acrobat JavaScript environment, all of the objects and functions are exposed. However there are a couple of limitations. First, the JSO runs in the current document context, so it is not priveleged. Second, VB and JavaScript have different data types. So not everything will transfer as function arguments. Especially from .Net which uses late binding because of the interop proxy.

So the best appoach is to write a folder level fucntion that implenents everything you want to run in JavaScript, then call this function from the JSO. For example, say the function is called MyCollabFn(); Then you'd call it from the JSO as

myJSO.MyCollabFn()

BTW: this will probably need to be a trustedFunction, and make sure it works from a document script before testing in the VB app.

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

anoopmohan
Registered: Feb 11 2010
Posts: 13
Hi Thomp,

Is there somewhere that I can get a relatively simple tutorial to walk me through the whole process ? once I have the basic process down I can figure out how to add to it and change it.

Thanks
Anoop
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Why yes there is. The Acrobat SDK has samples, and the documentation explains more or less how it all works. You'll find it all at the links in my first post.

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

arun1380
Registered: Feb 10 2011
Posts: 1
HI Anoop,
did you finally work out how to implement collab.hashstring() in c#. if so, do let me know

Thanks
Arun1380