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

[pdf embed api] highlight annotation default color

Explorer ,
Aug 26, 2021 Aug 26, 2021

Copy link to clipboard

Copied

Hi all,

Is there any way to change the default color of the highlight annotation to a random one?

I want that each time i highlight a text with annotation i could give it a different color.

Views

404

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 ,
Aug 26, 2021 Aug 26, 2021

Copy link to clipboard

Copied

LATEST

Yes. Look at the "startAnnotationMode API" section of the documentation. The code will look like this except you'll be generating your own color.

 

const mode = "highligh";
const options = {
  defaultColor: "#b80000"
};

previewFilePromise.then(adobeViewer => {
        adobeViewer.getAnnotationManager().then(annotationManager => {
                annotationManager.startAnnotationMode(mode, options)
                        .then(result => console.log(result))
                        .catch(error => console.log(error));
   });
});

  

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
Resources