Polygon annotation with add/remove points

19 views
Skip to first unread message

Valentin Marteau

unread,
Mar 12, 2021, 6:27:27 PM3/12/21
to PDFTron WebViewer
Hello,

Is there a possibility to add / remove points once a polygon annotation has been drawn?

Thanks and best regards,
Valentin

Anthony Chen

unread,
Mar 15, 2021, 1:56:10 PM3/15/21
to PDFTron WebViewer

Hi Valentin,

You can use the "getPath" API on the annotation to get the array of points ( https://www.pdftron.com/api/web/Annotations.PolygonAnnotation.html#getPath__anchor ).
If you modify the array ( push, slice, etc), it will affect the annotation.

Alternatively, you can also use the "addPoint" , "popPath", and "setPathPoint" to manipulate the path ( https://www.pdftron.com/api/web/Annotations.PolygonAnnotation.html ).

Anthony
Software Developer
PDFTron Systems, Inc.

CONFIDENTIALITY NOTICE: This message (and any attachment to it) is intended only for the use of the individual or entity to which it is addressed in the header, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. Any reproduction, distribution, modification or use of the contents of this message (and any attachment to it) by any individual or entity other than the intended recipient is prohibited. If you have received this communication in error, please notify us immediately and delete the original.

Reply all
Reply to author
Forward
0 new messages