因此,我从文本框中打印出一些文本,该文本框启用了自动换行功能,但是当我打印出文档时,应该自动自动换行的字符串却没有,并切断了页面上的内容。我想简单地为我的打印文档启用word换行。还有一种方法可以设置打印文档的页边距,一些文本会同时从上边距和左边距中切掉。谢谢!代码附在下面。
FixedDocument document = new FixedDocument();
document.DocumentPaginator.PageSize = new Size(printDlg.PrintableAreaWidth, printDlg.PrintableAreaHeight);
FixedPage page1 = new FixedPage();
page1.Width = document.DocumentPaginator.PageSize.Width;
page1.Height = document.DocumentPaginator.PageSize.Height;
MessageBox.Show(page1.Height.ToString() + page1.Width);
GridType.Children.Remove(Textbox);
page1.Children.Add(Textbox);
PageContent page1Content = new PageContent();
((IAddChild)page1Content).AddChild(page1);
document.Pages.Add(page1Content);
printDlg.PrintDocument(document.DocumentPaginator, "My first document");
page1.Children.Remove(Textbox);
GridType.Children.Add(Textbox);发布于 2013-07-11 23:09:32
您的文本框设置将不会在PrintDoc中应用。您必须在printdoc printpage event中重新计算所有内容
https://stackoverflow.com/questions/17596947
复制相似问题