IAM无法在WPF中以正确的格式正确打印 [英] iam not able to print in the correct in the correct formate in wpf

查看:91
本文介绍了IAM无法在WPF中以正确的格式正确打印的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi
大家早上好,我正在C#.net的wpf中执行打印应用程序,我可以从文本框中打印内容,但是,打印页面看起来像不同的字体和不同的字体大小,而且到期为此,我没有从打印机获得可见的东西,因此我需要在打印时使用C#来更改字体和大小以及行距,所以请给我一个主意,

我的示例代码是

hi
good morning everybody , iam doing the application of printing, in wpf in C#.net, from my application the i am able to print the matter in textbox , but , the printing page look like a different font and different fontsize, and more over due to this iam not getting the visiable matter from the printer , so that i need to chanege the font and the size nad line spacing by using C# while printing , so please me an idea,

my sample code is

FlowDocument doc = new FlowDocument(new Paragraph(new Run(textBox1.Text)));
          doc.Name = "FlowDoc";
          IDocumentPaginatorSource idpSource = doc;
          PrintDialog printDlg = new System.Windows.Controls.PrintDialog();
          printDlg.PrintDocument(idpSource.DocumentPaginator, textBox1.Text);




给我一个想法




give me and idea

推荐答案

您使用的Run元素具有可更改字体,字体样式的属性.

此处 [ ^ ]
The Run element you used have properties to change the Font, Font Styles.

Take a look here[^]


这篇关于IAM无法在WPF中以正确的格式正确打印的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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