简体   繁体   中英

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

How to set label size using 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).

要为Draw方法提供参数时,要绘制的任何东西都一定具有您指定的大小。框架不会对此进行更改。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM