remove page from fixed document?

霸气de小男生 提交于 2019-12-21 16:47:23

问题


How can I remove a page from a fixedDocument?

I add pages like this:

// 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;

But there is no 'fixedDocument.Pages.Remove(page)' method! What can I do?


回答1:


Could you try "cloning" the document into a new document and copy / move all pages over to the new document, except for the one(s) you want to remove?

Not sure if that would work or not.




回答2:


I know this is an old question but this came up for me recently.

public class MyFixedDocument : FixedDocument
{
    public FamilyLawFixedDocument() : base() { }

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


来源:https://stackoverflow.com/questions/6814992/remove-page-from-fixed-document

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!