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)
}
}) ```