打印时进行文字包装 [英] Textwrapping while printing

查看:59
本文介绍了打印时进行文字包装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Draw String中应用文本warpping?

how to text warpping apply in Draw String??

推荐答案

你好Sruthi,



你试试



Hi Srut

you just try

PrintDocument p = new PrintDocument();
           p.PrintPage += delegate(object sender, PrintPageEventArgs e)
           {
               int i=0;
               foreach (string s in arr)
               {
                   i++;
                   e.Graphics.DrawString(s, new Font("Times New Roman", 12), new SolidBrush(Color.Black), new ReftangleF(0,0,p.Width,p.Height));
               }
           };
           try
           {
               p.Print();
           }
           catch (Exception ex)
           {
               throw new Exception("Exception Occured While Printing", ex);
           }


如果你使用
Graphics.DrawString Method (String, Font, Brush, RectangleF, StringFormat)



并指定矩形,它将包裹在矩形内。



查看 http://msdn.microsoft.com/en-us/library/21kdfbzs .aspx [ ^ ]

希望有所帮助



Milind


and specify the rectangle,it will wrap inside the rectangle.

Check http://msdn.microsoft.com/en-us/library/21kdfbzs.aspx[^]
Hope that helps

Milind


这篇关于打印时进行文字包装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆