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.
Copy link to clipboard
Copied
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));
});
});