Skip navigation
HJS2
Currently Being Moderated

Is there any way to determine if a link is a book mark or hyperlink in java script

Aug 16, 2012 12:29 PM

Tags: #hyperlink #to #opendoc

Is there any way to determine if a link is a book mark or hyperlink in java script

Sub Problem:

I am making an array of quads of all the hyperlinks in a document. I would like to automatically skip over all the bookmarks in the starting pages of a document and just get the links of the hyperlinks.

Now I have to manually set the pages that contain bookmarks so they are not included in the array.

Is there any way to determine if a link is a book mark or hyperlink in java script?

 

It would help automate the conversion I need below

John

 

 

Main Problem:

I have been working on converting a set of pdf files with 1000’s of hyperlinks like www.site.com\folder1\file1.pdf#page=10

To jump to a local copy of the files with a relative type link

../folder1/file1.pdf and then go to the proper page.

I have found that it can be done manually by changing the hyperlink to a javascript

var otherDoc = app.openDoc('../folder1/file1.pdf', this);otherDoc.pageNum = 10 - 1;

and setting each destination file with a disclose()=true;

Based on the help so far that java script cannot access the hyperlink value in a link

See: http://forums.adobe.com/thread/1039908?tstart=60

I have resorted to the following plan using acrobat javascript, an external keyboard macro recorder and excel in combination to get around the problem

Four folder level acrobat javascripts with “buttons”

One to get all the link quads in an array, in the pdf and report the total number

The second creates a form field in the far corner of the first page and moves there.

The third jumps to each link found by creating a form field just to the left of the link and zooms in so it can be selected by a “mouse click” from the keyboard macro recorder 

The forth deletes the form field

 

The keyboard macro recorder runs javascript 2 and then 3 then clicks on the link just to the right of the middle of the screen and uses keys to get to the advanced editing to get to edit the hyperlink .

The hyperlink is then copied to excel where it is converted using string functions to the needed javascript text to be copied back.

To the acrobat file into a java script (after deleting the hyperlink)

Rinse/lather/repeat

 

I have been able to convert about 150 links an hour.

Better then hand typing, but not like having java access to the links.

 

I am looking to improve the solution

 
Replies
  • Currently Being Moderated
    Aug 16, 2012 4:55 PM   in reply to HJS2

    I haven't looked at this lately to see if this has changed, but I never thought that any method in Acrobat would mix up bookmarks and links. In fact, bookmarks don't really have a quad, since the quad is for the SOURCE, and bookmarks have no source, they just live in their own panel.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points