Please enable JavaScript to view this site.

ZTERM

Just like a terminal has rows and columns, the GDI engine has a coordinate system. However, because of differences in printers, the coordinates change. As a result, it's important to use calculated values whenever using positioning, line drawing etc.

Coordinates are long (i.e. 32-bit unsigned) values, with 0,0 being the top left of the printed page (regardless of portlight and landscape modes). The X-axis continues to the right and the Y-axis goes down.

In order to obtain the size of the printed sheet, use the Get Paper Size escape. This sequence will return the x and y coordinates of the bottom right of the page. Other escape sequences are provided to get the size of bitmap, the size of text. By using the values returned in your calculations, you can position text, lines and bitmaps exactly where they should be, regardless of the printer.