开发者

How to set label size using namespace System.Drawing.Printing?

开发者 https://www.devze.com 2023-02-11 09:23 出处:网络
How to set label size u开发者_开发问答sing namespace System.Drawing.Printing. Of Fix size? I want 6 labels of some size on a page size of 8.5X11In .net you can use a PrintPage handler for the PrintDoc

How to set label size u开发者_开发问答sing namespace System.Drawing.Printing. Of Fix size? I want 6 labels of some size on a page size of 8.5X11


In .net you can use a PrintPage handler for the PrintDocument object. Inside the PrintPage handler, use e.graphics for the printer output. With e.graphics, the location and size is based on 100 pixels per inch, regardless of the printer's resolution. So, for example, if you want 6 evenly spaced labels over 8 inches, you could position them 114 units apart, 100 * 8/(6+1), (plus the location of the first label).


Any thing you want to draw will surely will have the size that you specify when giving parameters to Draw method.. framework is not going to change that.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号