I removed the document screenshots from my last post.
All shapes are generally represented as annotations to make changes or use the annotation functionalities.
For text based annotations, we use the quad property, whereas other annotations will use the Rect property:
But please note that this will require you to either save the annotations (externally as XFDF data) or have it embedded within the input PDF.
For WebViewer, we do not have capabilities for extracting shapes from a document without annotations. This can be possible with our Core SDKs, please see this forum post for more information: