Following examples can be found and executed in GemBox.Document Sample Explorer under category 'Element Manipulation'.
Samples
- Cloning
Document element instances in GemBox.Document can be only at one single location in a document at a time. To insert document element into some other part of the same document, it must be cloned and clone should be inserted.
Following sample demonstrates how to clone document elements, first by cloning a section and its content, and then by individually cloning section content elements – blocks.
- Importing
Document element instances from one document instance cannot be inserted to another document instance. They must first be imported to another document, and then imported elements can be inserted.
This sample shows how to import a document element into another document.
- Iterating
GemBox.Document represents a document as a tree-like structure consisting of various document elements with a DocumentModel element as a root element.
GemBox.Document provides a way to flatten document representation, so it can be iterated.
Following sample demonstrates how to iterate over a document content tree and filtering an element sequence to a specific document element types.