As in PostScript, in the Adobe PDF Library the matrix is the primary method used to control where PDF elements are placed on a page, and the size (scale) of those elements:
These values are expressed in the format [a b c d h v]. So the first four numbers of the matrix are scale factors, and have no units. The last two describe how the object twill be moved on the page. These two final values are in the units that were in effect prior to the transformation. That is, if you add scaling, so that the size of the element is doubled (a = 2), the units applying to values h and v will also double.
To scale an element evenly, use [Scale 0 0 Scale 0 0].
To move an element to a given point, use [1 0 0 1 Xpos Ypos].
The default unit is 1/72 of an inch, or one point. So [1 0 0 1 72 72] would move an object one inch (72 points) to the right (h, or horizontal) and one inch (72 points) up (v, or vertical).
Or, in another example, applying the matrix [2 0 0 1 -10 10] at a current position of [10,10] would take you to [10,20] in the transformed system:
Xnew = (a * Xold) + (c * Yold) + h and Ynew = (b * Xold) + (d * Yold) + v
where: a = 2; b = 0; c = 0; d = 1; h = -10; v = 10; Xold = 10; Yold = 10
10 = (2 * 10) + (0 * 10) + (-10) and 20 = (0 * 10) + (1 * 10) + 10
To rotate an image on the page a matrix, use the following algorithm as a guide:
For more information about matrices, see Section 8.3.3, “Common Transformations,” in the ISO 32000 Reference, page 117 and Section 8.3.4, “Transformation Matrices,” on page 119. Find this document on the web store of the International Standards Organization (ISO).