使用printdocument打印时,C#动态生成的字符串分为两行 [英] C# dynamically generated string divide into two line while printing using printdocument

查看:110
本文介绍了使用printdocument打印时,C#动态生成的字符串分为两行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了发票,其中生成了一个卢比的单词,但由于长度很长,我必须将这条卢比线分成两行。我怎么能这样做?

I have created invoice in which it generated a rupees in words but i have to dive this rupees line in two line because of long length. How can i do this?

推荐答案

有几种方法可以做到这一点,但说实话,最简单的解决方案是改变输出方式它。如果您问这个问题,那么您可能正在使用基于点的重载之一。而不是当前的DrawString,看看使用带有矩形的重载之一: http:// msdn。 microsoft.com/en-us/library/21kdfbzs.aspx [ ^ ]。



系统将为您处理包装。
There are a couple of ways to do it, but to be honest, the simplest solution would be to change the way you are output it. If you are asking this question, then you are probably using one of the point based overloads. Instead of your current DrawString, look to use one of the overloads that takes a rectangle: http://msdn.microsoft.com/en-us/library/21kdfbzs.aspx[^] for example.

The system will than handle the wrapping for you.


这篇关于使用printdocument打印时,C#动态生成的字符串分为两行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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