• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How set action type , if add a link?

Enthusiast ,
Feb 05, 2018 Feb 05, 2018

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:

linkjs.png

How can set type of Action is [Go to a page in docment]?

linkadd.png

TOPICS
Acrobat SDK and JavaScript

Views

681

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 05, 2018 Feb 05, 2018

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Feb 05, 2018 Feb 05, 2018

Copy link to clipboard

Copied

Exist any solutions can process?

or other Libs?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 05, 2018 Feb 05, 2018

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Feb 05, 2018 Feb 05, 2018

Copy link to clipboard

Copied

Where link can buy?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 05, 2018 Feb 05, 2018

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 06, 2018 Feb 06, 2018

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.

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 06, 2018 Feb 06, 2018

Copy link to clipboard

Copied

LATEST

George: That's a brilliant idea. I love it!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 06, 2018 Feb 06, 2018

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines