Thank you. This has been helpful. I am still having a problem in that when trying to import the nodes found using the pagefinder RetrieveAllNodesOnPage, if the node is anything other than a paragraph (Ex: Table), I get a “cannot insert node of this type at this location”.
What I really need to do, is to be able to specify pages within a given document and have everything from those pages (headers, footers and content) cloned into a new document. Is this possible?
Here is a sample of what I have now (this page has a table on it, and it returns an error):
Document doc = new Document(@"c:\test.doc");
PageNumberFinder pageFinder = new PageNumberFinder(doc);
Document dstDoc = new Document();
NodeImporter importer = new NodeImporter(doc, dstDoc, ImportFormatMode.KeepSourceFormatting);
//just extract page 4
for (int pageNum = 4; pageNum <= 4; pageNum++)
List<Node> pageNodes = pageFinder.RetrieveAllNodesOnPage(pageNum, true);
if (pageNodes != null)
foreach (Node paragraph in pageNodes)
Node importNode = importer.ImportNode(paragraph, true);