开发者

remove page from fixed document?

开发者 https://www.devze.com 2023-03-22 13:01 出处:网络
How can I remove a page from a fixedDocument? I add pages like this: // Add page to pageContent PageContent pageContent = new PageContent();

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?


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.


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);
    }
}
0

精彩评论

暂无评论...
验证码 换一张
取 消