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

How to Customize/Edit the Actual HyperLink Code in a PDF

Community Beginner ,
May 28, 2020 May 28, 2020

Copy link to clipboard

Copied

I have a PDF book catalog with hyperlinks on each book's title and cover art.  I need for the link to trigger a JavaScript action using a class selector.  In normal page code the link would look like this:

<a href="#" class="book_3">

 

I'm assuming the HyperLink editor in Acrobat is only set up to accept the basic URL which, in this case, there isn't one.  This one includes a class declaration.  Is there a way to back my way into the actual link code on a PDF once it's been set by the link editor so I can edit, or another way of doing this?

 

Thanks.

TOPICS
Edit and convert PDFs , How to

Views

1.8K

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 ,
May 29, 2020 May 29, 2020

Copy link to clipboard

Copied

I believe that what you're referring to with: 

<a href="#" class="book_3">

 

is for setting up navigational links  thst will always appear at the top of the specified page by default.

 

Is this an HTML document that you will  download and open directly in Acrobat?

 

If that is the case you can use File>>>Create>>> PDF from Web Page...

 

This is a lengthy process though, and it depends on how big is the HTML document, not just the network speed and bandwidth, but you will have a PDF with named destination readily available and use it with the create weblink tool in Acrobat.

 

If you're referring to creating document links that will aid the user to navigate inside of the PDF itself instead of creating a URI action that will open and go to a specific  webpage in a web browser, you can use the same tool that is used to create weblinks in Acrobat.

 

If you open the Edit PDF tool, for example, click on the "Link" button in that toolbar then click on "Add/Edit" Web or Document Link".

 

The "Create Link" dialogue box will open. Tick the radio button Go to a page view" and click on Next.

 

Draw with the mouse the box where you want this link positioned in that page.

 

Soon after that,  a popup box  titled"Create Go to View" will open next ; click on the "Set Link" button.

 

When this procedure is complete, your link box will be high-lighted with a blue frame.

 

This indicates that you can do additional edits to the properties of this link box.

 

To do so, right-click on that link box, select Properties from the context menu, and then select the "Actions" tab.

 

You will be able to set the page that you want this link to open and the zoom level, OR,  you can also specify to use a Named Destination instead of a page number. This is why using the File>>>Create>>> PDF from Web Page... method that I menationed earlier is very handy.

 

Is this is what you're looking for?

 

 

 

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 ,
May 29, 2020 May 29, 2020

Copy link to clipboard

Copied

This is not possible to do with a web-link in a PDF file, which can only execute a simple URL.

A script can execute a more complex HTTP Request, but I'm not sure that will work in your case.

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 ,
May 30, 2020 May 30, 2020

Copy link to clipboard

Copied

LATEST

Please also evaluate my recommendation for another user here:

 

https://community.adobe.com/t5/acrobat/how-to-create-a-new-container-tag/m-p/11170149?page=1#M259641 

 

There seems to be a bug associated with the Weblink plug-in as it doesn't or will refuse to treat that hyperlink as an annotation in your PDF.

 

If you need to use special and reserved characters as PDF opening parameters, it also fails to encode/decode the UTF-8 default used by URI actions.

 

Like Try67 suggested, you will not have issues going with a javascript solution.

 

The workaround is very simple: don't use the weblink plug-in to generate URI 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