How to interpret rectangle coordinates in PDF?

I would like to know more about the coordinates of the rectangle, in particular:

  • bottom left X
  • bottom left Y
  • top right X
  • upper right Y

Each time, I am confused about how to make dimensions based on these coordinates to draw a rectangle.

If possible, can I briefly present a graphical representation of these coordinate positions?

+6
source share
1 answer

Before anyone can explain what about the lower left X, lower left Y, upper right X and upper right corner Y of the rectangle, you need to know about the coordinate system: Where is the beginning (x, y) of the PDF page?

The answer to this question contains all the necessary information, with the exception of the graphical representation that you request. This is a simple representation of the coordinate system:

enter image description here

The origin of the coordinate system (0, 0) . Positive values โ€‹โ€‹of X are to the right of the origin, positive values โ€‹โ€‹of Y are above the origin.

I drew a Rectangle and indicates where you can find the lower left corner (with coordinate (llx, lly) ) and the upper right corner (with coordinate (urx, ury) ).

The sides of the rectangle are always parallel to the X and Y axis, so you only need two coordinates to define the rectangle.

+8
source

Source: https://habr.com/ru/post/988830/


All Articles