How does the front end draw a rectangle on the uploaded picture according to the coordinates given by the back end?

as shown in the picture, the picture I uploaded on the left is displayed in the div above. The back end recognizes the coordinates of the text on the right, and the front end identifies the text in the position box (red box) on the left picture according to the coordinates. The text result should be displayed on the red box. How should I do this? Should we get the picture and draw it with canvas? God, give me some ideas.

Jul.24,2021

< H2 > effect < / H2 >

clipboard.png


clipboard.png


you can create a new div, and then set the width, height and positioning of the div according to the coordinates


the best solution should be to use canvas to draw, the points inside the canvas have corresponding api to obtain the coordinates, that is, roughly draw the ID card background, and then fill in the data according to the coordinates.
there is another solution. I wonder if it can be written according to the ID card style first, leaving only the data that needs to be filled, and the data taken to the background can be filled in according to the normal layout of the ID card. I haven't done this kind of project, it's just a personal opinion. )

Menu