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

How do I convert or add highliting to underlining?

New Here ,
Apr 27, 2016 Apr 27, 2016

Hi,

For a year or so I've commented with text selection underlining not text selection highlights. A new reference/pdf software program I am switching to (citavi) requires me to convert all my underline annotations to highlite annotations, or at least to add highlites over the same text.  (Citavi only recognizes highlights from external pdf viewers).

Is there a way to do this?  I use Adobe Acrobat Pro DC.

Thank you

TOPICS
Acrobat SDK and JavaScript , Windows
1.2K
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

correct answers 1 Correct answer

LEGEND , Apr 28, 2016 Apr 28, 2016

It's easy to convert using JavaScript. The following script run from the interactive JavaScript console (Ctrl+J) will do it, though you may want to add additional code to set the color to something else.

// Get an array of all of the annotations in the document

syncAnnotScan();

var annots = getAnnots();

// Loop through the comments

// and convert any underlines to highlights

for (var i = 0; i < annots.length; i += 1) {

    if (annots.type === "Underline") {

        annots.type = "Highlight";

    }

}

To exe

...
Translate
LEGEND ,
Apr 28, 2016 Apr 28, 2016

It's easy to convert using JavaScript. The following script run from the interactive JavaScript console (Ctrl+J) will do it, though you may want to add additional code to set the color to something else.

// Get an array of all of the annotations in the document

syncAnnotScan();

var annots = getAnnots();

// Loop through the comments

// and convert any underlines to highlights

for (var i = 0; i < annots.length; i += 1) {

    if (annots.type === "Underline") {

        annots.type = "Highlight";

    }

}

To execute it, paste all of the code shown above, select it all, and press Ctrl + Enter. All underline comments will be changed to 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 ,
Apr 28, 2016 Apr 28, 2016
LATEST

You can even use the code above as a part of an Action and process all of your files at once. I will just change it a bit so it doesn't fail if there are no comments in the file, and use this code instead:

// Get an array of all of the annotations in the document

this.syncAnnotScan();

var annots = getAnnots();

if (annots!=null) {

    for (var i = 0; i < annots.length; i += 1) {

        if (annots.type == "Underline") {

            annots.type = "Highlight";

        }

    }

}

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