Then you have to use some draw library to draw those on an image/pdf. Or you could use it to absolutely position rectangles, but I’m not sure how that would work.
I’d absolutely position rectangles over the PDF. So you’d have a rectangle of position relative, then inside that your PDF viewer, then adjacent to that your divs (or another wrapper div that is also position relative). The individual polygons would all be position absolute. That lets you draw rectangles on “top” of the PDF.
The generalized form of a polygon is a list of points that make it up, with each edge being the line drawn between each pair of points. The last line is implied by going from the last point to the first point. If you know it is a rectangle, then the first point and the third point are all you need to figure out the bounding box.
The format of the numbers makes it look like they represent the % of page width and height. You can multiply by 100 and add a “%” at the end to get the x/y and the width/height going for you. That positions a div that you can put anything else inside.
There’s some work between here and there, but I hope this gets you started for your initial experimentation!
Yeah, that might be a solution, but it should be responsive with the screen resize/rem units etc. also he needs to calculate the width/height based on the points. Other than that, this would be the first approach I’d go for.