首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >PrintDocument (FixedDoc) WordWrapping?

PrintDocument (FixedDoc) WordWrapping?
EN

Stack Overflow用户
提问于 2013-07-11 23:03:56
回答 1查看 155关注 0票数 0

因此,我从文本框中打印出一些文本,该文本框启用了自动换行功能,但是当我打印出文档时,应该自动自动换行的字符串却没有,并切断了页面上的内容。我想简单地为我的打印文档启用word换行。还有一种方法可以设置打印文档的页边距,一些文本会同时从上边距和左边距中切掉。谢谢!代码附在下面。

代码语言:javascript
复制
        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);
EN

回答 1

Stack Overflow用户

发布于 2013-07-11 23:09:32

您的文本框设置将不会在PrintDoc中应用。您必须在printdoc printpage event中重新计算所有内容

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/17596947

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档