
In Rotated User Space the origin is always the bottom left hand corner of the page shown on the screen. Rotated user space is measured with the Crop Box. In Default User Space the origin (0,0 point) is always the bottom left hand corner of the printed page. Default User Space is measured with the Media Box. To handle these two situations Acrobat JavaScript uses two different coordinate systems, Default User Space which represents the printed view, and Rotated User Space which represents the on-screen view.
#Using pdf on browser screen annotation full size
Thus, we have two situations, the rotated cropped view that the user sees on the screen, and the unrotated full size page that gets printed. But the page would still need to be printed in the regular letter size page orientation. On the computer you'd want to see the page rotated with the long side down so you could see the content properly. For example it might display a very wide table of data. And vise-a-versa, if a script tries to make the Crop Box larger than the Media box Acrobat will automatically grow the Media Box.To illustrate this idea imagine a standard letter size page designed to be viewed in landscape mode.

If a script attempts to make the Media Box smaller than the Crop Box, then Acrobat will automatically adjust the size of the Crop Box to be smaller.

The only restriction is that the Crop Box is always inside the Media Box. These two boxes are often exactly the same, but they can of course be different sizes, and they can also be different rotations. The Crop box is what the user sees on the computer screen. As explained earlier, the Media Box is meant to represent what the user would see if they printed out the PDF page. The two most important boxes for scripting, and handling page geometry in general, are the Media Box and the Crop Box. These empty areas are usually the result of an inefficient or in some cases a down right poor PDF creation process. PDF content often includes invisible boundaries that extend beyond the visible elements. Ideally, a line drawn around the BBox would touch the edges of the visible content on all four sides of the page. This box is calculated by Acrobat and so it cannot be modified by a script. The BBox, or the Bounding Box, is the smallest rectangle that can enclose all the content on the page. They represent important stages in the printing of a document, but are invisible to the average user and unimportant for our purposes here, so they won't be discussed. The next 3 boxes, Art, Bleed, and Trim, have special meaning to printers. But it is still very important to page geometry, as will be explained below. The Media Box doesn't have quite the same importance for an interactive document displayed on the screen. And all the other bounding boxes are inside this one. Originally this meant the paper size the page was to be printed on. Horizontal, or X, coordinates increase to the rights and vertical, or Y, coordinates increase towards the top (Figure 1)įigure 2 - The different Page Boxes that define a page's boundaries. The origin, or 0,0 point is located in the bottom left hand corner of the page. The units of User Space are called "points" and there are 72 points/inch. And in fact that's a good way to think about it. This is a flat 2- dimensional space, just like a piece of paper. The coordinate system on a PDF page is called User Space.


So understanding page coordinates is critical to many common automation activities. Page coordinates are used to add fields and annotations to a page, move fields and annotations, resize page boundaries, locate words on a page, and for any other operation that involves page geometry.
