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

Global hyperlink styles control

Explorer ,
Oct 17, 2022 Oct 17, 2022

How can one select all the hyperlinks in a document (there could be thousands) and change their style at one time? Of particular importance to me is being able to set the Highlight Style to None.

TOPICS
Edit and convert PDFs , How to
2.9K
Translate
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
4 ACCEPTED SOLUTIONS
Explorer ,
Oct 20, 2022 Oct 20, 2022

Hello @try67 

Just had a chance to learn about and try out the JS Console, etc. 

I'm in the JS debugger, Console mode selected, and after copy and pasting the script you sent, I do Control Enter, with the cursor at the end of the script, but it complains Syntax error 1 console exec undefined. 

 

Keeping in mind my lack of experience, what's a likely reason for this?

Thanks so much!

 

 

 

 

 

View solution in original post

Translate
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 ,
Oct 20, 2022 Oct 20, 2022

You must select the full code first, using the mouse or keyboard.

View solution in original post

Translate
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 ,
Oct 20, 2022 Oct 20, 2022

You can place it under a Custom Command or an Action for quick access.

Another option is to place it in a .js file and attach it to a new menu or toolbar button, but that requires some changes to it.

 

The "None" at the end is just the highlight value that is being used. It means the code ran, actually.

View solution in original post

Translate
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 ,
Oct 20, 2022 Oct 20, 2022

You need to resize your links so they don't exceed (or overlap) with the page's boundaries for the script to pick them up.

 

You can set the default view options for the file (including Full Screen) under File - Properties - Initial View.

View solution in original post

Translate
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 ,
Oct 17, 2022 Oct 17, 2022

I'ts not possible out of the box, but @try67 could probably write a script to accomplish that.

Translate
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 ,
Oct 17, 2022 Oct 17, 2022

I've been summoned... 🙂

Here you go:

 

for (var p=0; p<this.numPages; p++) {
	var box = this.getPageBox("Crop", p);
	var links = this.getLinks(p, box);
	if (links==null || links.length==0) continue;
	for (var i in links) {
		links[i].highlightMode = "None";
	}
}
Translate
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
Explorer ,
Oct 17, 2022 Oct 17, 2022
Well, an interesting solution! Thank you. How/where does one apply this script?

BTW for Acrobat on Android, the link highlights don't show up, but they do in Android for Windows. Anyway for my application, it's important to set Highlights to None.

Thanks again everyone... Let me try this out shortly.

NB

SocialEyes Corporation
WhatsApp +977 98 2332 8602
GMT +5:45
Translate
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 ,
Oct 17, 2022 Oct 17, 2022

Android for Windows?? Do you mean Acrobat for Windows, perhaps?

 

You can run this script from the JS Console, or you could attach it to a Custom Command or an Action (in Acrobat Pro). The former will allow you to run it on the current file with a single click. The latter will allow you to run it on multiple files, with just a few clicks (make sure to also add a Save command, if you do that, though).

Translate
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
Explorer ,
Oct 17, 2022 Oct 17, 2022
Time to learn something new! Will try out the JS Console, as well as the alternatives. Yes, Acrobat Pro is being used.

SocialEyes Corporation
WhatsApp +977 98 2332 8602
GMT +5:45
Translate
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
Explorer ,
Oct 20, 2022 Oct 20, 2022

Hello @try67 

Just had a chance to learn about and try out the JS Console, etc. 

I'm in the JS debugger, Console mode selected, and after copy and pasting the script you sent, I do Control Enter, with the cursor at the end of the script, but it complains Syntax error 1 console exec undefined. 

 

Keeping in mind my lack of experience, what's a likely reason for this?

Thanks so much!

 

 

 

 

 

Translate
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 ,
Oct 20, 2022 Oct 20, 2022

You must select the full code first, using the mouse or keyboard.

Translate
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
Explorer ,
Oct 20, 2022 Oct 20, 2022

All the code, about 8 lines, is selected and highlighted. I then pressed Ctrl Enter, and the script returned None. And Lo! and Behold!, all the highlighting has been removed.

Now, what's an easy way to save the script for future use?

Translate
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 ,
Oct 20, 2022 Oct 20, 2022

You can place it under a Custom Command or an Action for quick access.

Another option is to place it in a .js file and attach it to a new menu or toolbar button, but that requires some changes to it.

 

The "None" at the end is just the highlight value that is being used. It means the code ran, actually.

Translate
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
Explorer ,
Oct 20, 2022 Oct 20, 2022

Got it... Let me read up on how to use Custom Command or Action. I have found them but need to get oriented on how to use them, etc. 

 

Many thanks!

Translate
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
Explorer ,
Oct 20, 2022 Oct 20, 2022

BTW how does one force a PDF to open in Single Page View, or in Full Screen? 

Translate
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
Explorer ,
Oct 20, 2022 Oct 20, 2022

Almost all the highlights... The first text box behaves correctly, the second and third don't. All the hyperlinks on text and pictures work correctly, meaning no highlights

Translate
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 ,
Oct 20, 2022 Oct 20, 2022

You need to resize your links so they don't exceed (or overlap) with the page's boundaries for the script to pick them up.

 

You can set the default view options for the file (including Full Screen) under File - Properties - Initial View.

Translate
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
Explorer ,
Oct 23, 2022 Oct 23, 2022
LATEST

Finally, is it possible to prevent a reader from navigating beyond a certain page? They can read from page 1 to x, but not beyond.

 

For example, in my presentation, there are some pages with images at the end, which we call from the hyperlinks and they popup as expected. However, I'd like to make them hidden, so to speak, when using the ordinary navigation process.

Translate
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