Copy link to clipboard
Copied
I add a link to Page by JS:
l = addLink(p, [r2[4], r2[5], r2[2], r2[3]]);
l.borderColor = color.red;
l.borderWidth = 1;
l.setAction("this.pageNum = " + dctPageName[iPageGoto] );
Type of Action is: Run a Javascript:
How can set type of Action is [Go to a page in docment]?
Copy link to clipboard
Copied
You can't.
The only Actions you can add via JavaScript is "Run a JavaScript". However, if you create a bookmark manually that goes to a specific page and view, you can execute the bookmark via JavaScript.
Copy link to clipboard
Copied
Exist any solutions can process?
or other Libs?
Copy link to clipboard
Copied
Just about every PDF library tool will be able to create a link that is capable of setting any of the various link types. The one you choose depends on the platform, language, and price point you are comfortable with.
Copy link to clipboard
Copied
Where link can buy?
Copy link to clipboard
Copied
An approach that you can partially implement with JavaScript is instead of adding links, add buttons, which can have the same appearances and actions as links. You can set the actions of all such buttons by importing a properly constructed FDF. This is explained in more detail at the following: Planet PDF - Linking Up with FDF
If you really need to use link annotations, a plug-in that works with Acrobat is AutoBookmark: AutoBookmark™ Plug-in for Adobe® Acrobat® / Linking Functionality
It allows you to import a data file that creates links and actions.
Copy link to clipboard
Copied
Hey George, That's a brilliant methodology !! You could actually write the FDF file with JS, given a set of destination parameters. I wonder if there is a way to use the FDF to generate named destinations? That would be awesome.
I solved this issue by writing a plug-in to convert links. Much more direct.
Copy link to clipboard
Copied
George: That's a brilliant idea. I love it!
Copy link to clipboard
Copied
You can do it using this tool I've developed: Custom-made Adobe Scripts: Convert JavaScript Links To Real Links