【问题标题】:remove page from fixed document?从固定文档中删除页面?
【发布时间】:2011-10-12 12:01:07
【问题描述】:

如何从固定文档中删除页面?

我添加这样的页面:

// Add page to pageContent
PageContent pageContent = new PageContent();
((IAddChild)pageContent).AddChild(fixedPage);

// Add pageContent to wholeDoc
fixedDocument.Pages.Add(pageContent);

//Add to documentVeiwer
documentViewer1.Document = fixedDocument;

但是没有 'fixedDocument.Pages.Remove(page)' 方法!我能做什么?

【问题讨论】:

    标签: wpf xps fixeddocument


    【解决方案1】:

    您能否尝试将文档“克隆”到新文档中,然后将所有页面复制/移动到新文档中,您要删除的页面除外?

    不确定这是否可行。

    【讨论】:

      【解决方案2】:

      我知道这是一个老问题,但我最近遇到了这个问题。

      public class MyFixedDocument : FixedDocument
      {
          public FamilyLawFixedDocument() : base() { }
      
          public void RemoveChild(object child)
          {
              //call protected method of base class
              base.RemoveLogicalChild(child);
          }
      }
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-01-18
        • 1970-01-01
        相关资源
        最近更新 更多