How to add scale and color to the converted annotation

Hi,
As per the solution that you have provided to me for 3rd question from here - [SOS] Unable to find some workings in Pdfjs-express

I am converting area measurement annotation to linear measurement annotation.
Here I am getting values in inches, but I want it in meters with my custom scale, like 1m=100m.
Also how can I set color to it.?
How can I set scale before annotManager.addAnnotation(newAnnot); annotManager.redrawAnnotation(newAnnot)? I mean how can I set scale and color before exportAnnotations().
How can I use setStyles() or setAnnotationStyles() in here?

Here is the code snippet which you have provided to me.

  const annots = annotManager.getAnnotationsList();
  annots.forEach((annot) => {
    if (annot instanceof Annotations.PolygonAnnotation && annot.IT === "PolygonDimension") {
      const newAnnot = new Annotations.PolylineAnnotation();
      const paths = annot.getPath();
      paths.forEach(path => {
        newAnnot.addPathPoint(path.x, path.y);
      })
      newAnnot.Measure = annot.Measure;
      newAnnot.IT = 'PolyLineDimension';
      newAnnot.adjustRect();

      annotManager.deleteAnnotation(annot);
      annotManager.addAnnotation(newAnnot);
      annotManager.redrawAnnotation(newAnnot)
    }
  })  ```

Hi!

To change the color of the annotation you can set the FillColor and/or the StrokeColor on the annotation.

newAnnot.StrokeColor = new Annotations.Color(255, 0, 0, 1); // (rgba)
newAnnot.FillColor = new Annotations.Color(255, 0, 0, 1); // (rgba)

To change the scale you need to set the scale on the tool that is used to create the annot. In this case it’s AnnotationCreatePerimeterMeasurement.

You can find documentation here.

Thanks!
Logan