Polygon annotation with add/remove points

Skip to first unread message

Valentin Marteau

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

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

Thanks and best regards,

Anthony Chen

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 ).

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
0 new messages