Skip to main content
Known Participant
July 23, 2017
Question

How to batch underline all text in all pdf files in a folder ?

  • July 23, 2017
  • 2 replies
  • 3893 views

How to batch underline all text in all pdf files in a folder with acrobat DC pro ?

[Moved from the Adobe Acrobat Reader forum to Editing & Exporting PDFs by moderator.]

.

This topic has been closed for replies.

2 replies

try67
Community Expert
Community Expert
July 23, 2017

​All ​the text in ​all​ the files? What for?

Known Participant
July 29, 2017

Only want to underline or strike through searched text in files. I found a code online but its on color highlighting.

I am looking for something similar to this:i

// I copied it from somewhere online

// Highlight Color

var colHilite = color.yellow;

var oDoc = event.target;

var aAnnts = oDoc.getAnnots({sortBy:"Author"});

for(var i=0;i<aAnnts.length;i++)

{

   if(aAnnts.type == "Redact")

   {

      aAnnts.type = "Highlight";

      aAnnts.strokeColor = colHilite;

   }

}

try67
Community Expert
Community Expert
August 1, 2017

// I uglyphoto copied it from somewhere online

// Highlight Color

var colHilite = color.yellow;

var oDoc = event.target;

var aAnnts = oDoc.getAnnots({sortBy:"Author"});

for(var i=0;i<aAnnts.length;i++)

{

   if(aAnnts.type == "Redact")

   {

      aAnnts.type = "Highlight";

      aAnnts.strokeColor = colHilite;

   }

}


Do you mean the highlight color? It's not necessary to specify it, but it's possible if you want to... In the code above replace line #5 with:

this.addAnnot({page: p, type: "Underline", quads: wordQuads, strokeColor: color.yellow});

Bernd Alheit
Community Expert
Community Expert
July 23, 2017

Try a forum for Adobe Acrobat.