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

addLink is not defined error

New Here ,
Aug 16, 2018 Aug 16, 2018

Copy link to clipboard

Copied

I'm creating a feature in acrobat reader to navigate to a web page when certain words are clicked.

I'm using the 'addLink' function to do it by referring the book 'Developing Acrobat Applications using Javascript' but I'm getting the error 'addLink is not defined'

Please help with possible solutions

Thanks in advance

TOPICS
Acrobat SDK and JavaScript

Views

2.0K

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 ,
Aug 20, 2018 Aug 20, 2018

Copy link to clipboard

Copied

Using the link I get following error:

ReferenceError: newWord is not defined

1:Link:Mouse Up

Where did you set this variable?

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
New Here ,
Aug 20, 2018 Aug 20, 2018

Copy link to clipboard

Copied

Please have a look at the script which I'm using Dropbox - script.js

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 ,
Aug 20, 2018 Aug 20, 2018

Copy link to clipboard

Copied

This is not the script you used on the sample file you shared, because the link is not the same.

Post your actual code, please.

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
New Here ,
Aug 20, 2018 Aug 20, 2018

Copy link to clipboard

Copied

I have changed the link alone.Sorry for the change!!

The link is confidential

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 ,
Aug 20, 2018 Aug 20, 2018

Copy link to clipboard

Copied

Why did you include a variable in it, and where is that variable defined?

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
New Here ,
Aug 20, 2018 Aug 20, 2018

Copy link to clipboard

Copied

The 'newWord' is the variable and it is defined in the line

var nextWord = this.getPageNthWord(p, i+1, false);

The variable was included in the url to navigate to the web page based on the value of the variable

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
New Here ,
Aug 20, 2018 Aug 20, 2018

Copy link to clipboard

Copied

SorryIt is defined here,

newWord = ckWord.concat(nextWord);

should I add 'var' before it? Is that a mistake?

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 ,
Aug 20, 2018 Aug 20, 2018

Copy link to clipboard

Copied

Yes, that's better, but it's not the issue.

You need to include the actual value of that variable when you set the link, but include a reference to it.

If you post your actual code (just the line that sets the link's action is enough) we could help you change 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
New Here ,
Aug 20, 2018 Aug 20, 2018

Copy link to clipboard

Copied

I don't know what is wrong suddenly.I was not getting that error.Let me try that from my side

The actual issue for me is that 'addLink' is not working at the reader side even if the pdf is saved by adding links in the acrobat

Please give your help for this issue

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 ,
Aug 20, 2018 Aug 20, 2018

Copy link to clipboard

Copied

We did, but you're not making it easier because you're not providing us with the correct code you're using.

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
New Here ,
Aug 20, 2018 Aug 20, 2018

Copy link to clipboard

Copied

Consider this as my requirement like appending a word to the the URL

newWord="hai";

l.setAction("app.launchURL('http://www.google.com?q='+newWord);");

I'm getting error for this.How to resolve this?

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 ,
Aug 20, 2018 Aug 20, 2018

Copy link to clipboard

Copied

Use this:

newWord="hai";

l.setAction("app.launchURL('http://www.google.com?q="+newWord+"');");

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
New Here ,
Aug 20, 2018 Aug 20, 2018

Copy link to clipboard

Copied

Thanks much..It worked!!!

Is there any method to enable hyperlink feature through javascript for adobe reader?

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 ,
Aug 20, 2018 Aug 20, 2018

Copy link to clipboard

Copied

LATEST

No.

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 ,
Aug 20, 2018 Aug 20, 2018

Copy link to clipboard

Copied

You will get the error also in Adobe Acrobat. Restart Adobe Acrobat, open the file with, and try the link.

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 ,
Aug 20, 2018 Aug 20, 2018

Copy link to clipboard

Copied

Can you share a sample file?

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 ,
Aug 16, 2018 Aug 16, 2018

Copy link to clipboard

Copied

[Question moved to the JavaScript forum]

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