DocumentBuilder is a powerful class that is associated with a Document and allows to build a dynamic document from scratch or add new elements to an existing document. It provides methods to insert text, paragraphs, lists, tables, images, and other contents, as well as specification of font, paragraph, section formatting, and other things.
The DocumentBuilder complements classes and methods available in the Aspose.Words Document Object Model (DOM) to simplify the most common document building tasks such as inserting text, tables, fields, and hyperlinks.
The following code example shows how to insert an image into a document at a specified position and size:
You can also do the same using the Open XML SDK. At the same time, note that it looks somewhat more complicated and more cumbersome.
The following code example shows how to insert image into a body part of a Word document.