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

Convert a PDF with hyperlinks to grayscale

Community Beginner ,
Nov 02, 2023 Nov 02, 2023

Copy link to clipboard

Copied

I have a PDF (generated by LaTeX by someone who is not me) with a lot of internal hyperlinks. When I open this PDF on a computer or tablet, the hyperlinks have a colored outline, and when I print the PDF, the colored outlines (correctly) vanish.

 

I want to convert the entire document, including the link highlights, to grayscale—I don't want any color at all in the document. But I am not doing this to print the document—I still want the hyperlinks to work.

 

If I follow the usual convert to grayscale instructions (if I open the file in Adobe Acrobat and then go to Compress a PDF/Preflight/Prepress, Color and Transparency/Convert Colors/Convert to Grayscale), images do indeed convert to grayscale, but all of the internal hyperlinks are still highlighted in color.

 

If I instead go to Compress a PDF/Preflight/Prepress, Color and Transparency/Digital Printing and Online Publishing/Digital Printing (B/W)), the colored links vanish—because Acrobat has helpfully disabled all of the useful internal hyperlinks and I can't use them any more.

 

Is there any way to disable the hyperlink highlighting, or change the highlight color to grayscale, without deactivating the links entirely?

 

(If anyone's curious, my use case is annotation: I want to write a lot of comments on the document, in red, on my tablet. So I want to reserve colors for annotations; having a bunch of colored links is distracting. But I also want to navigate the document so I want the links to be there, just more unobtrusive.)

TOPICS
Edit and convert PDFs , Print and prepress

Views

185

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 ,
Nov 02, 2023 Nov 02, 2023

Copy link to clipboard

Copied

Can you share a few pages of this document?

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 ,
Nov 02, 2023 Nov 02, 2023

Copy link to clipboard

Copied

Set all links' border color to gray with this code:

 

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].borderColor = ["G", 0.5];
	}
}

 

To hide the border replace this line:

links[i].borderColor = ["G", 0.5];

With:

links[i].borderWidth=0;

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 Beginner ,
Nov 02, 2023 Nov 02, 2023

Copy link to clipboard

Copied

Is there somewhere in Acrobat Pro where I can paste this code? Or is it a Terminal command (I'm on Mac)? What do I do with 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 ,
Nov 02, 2023 Nov 02, 2023

Copy link to clipboard

Copied

LATEST

You can rut it from a Custom Command, an Action (in the Action Wizard) or the JS Console.

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