Accusoft.PrintPro8.Net
Set Printer Coordinates

Physical Area

The printer coordinate system is based on the physical dimensions of the paper in the printer. The horizontal and vertical starting position (0,0) is located at the upper left corner of the paper. Printer units are defined by the PrintUnits Property. The default PrintUnits is twips. There are 1440 twips per inch.

For example, if the printer has 8½ x 11in. paper and the orientation of the paper is portrait, the width of the printer is 12240 twips and the height is 15840 twips. You can get the physical height and width of the printer using the PaperHeight Property and PaperWidth Property.

Display Area

A printer also has a display area. The display area is located inside the physical area. The PrintPreviewScale Property can be used to get width and height of the display area. The DisplayX Property and DisplayY Property can be used to get the coordinates of the upper left corner of the display area. 

Printer Resolution

The resolution of a printer is measured in dots per inch. You can get the horizontal and vertical resolution of a printer using the PrintResolution Property.

There are times when you might need to know the number of twips per printer dot (or pixel). The TwipsPerPixelX Property and TwipsPerPixelY Property can be used to get the printer's horizontal or vertical twips per pixel. 

Internal Coordinates

The PrintPRO control maintains internal coordinates that are used and updated by some of the text, graphics and bitmap methods. The CurrentX Property and CurrentY Property can be used to get or set the internal horizontal and vertical coordinates.

For example, if the CurrentX and CurrentY properties are set to 1440 twips, the following code will print Hello World one inch from the top and left side of the paper since the PrintText method uses the CurrentX and CurrentY values to position the text.

Example
Copy Code
printJob.Draw.CurrentX = 1440;
printJob.Draw.CurrentY = 1440;
printJob.Draw.Text("Hello World");

 

 


©2015. Accusoft Corporation. All Rights Reserved.

Send Feedback