Insert Picture into a Document

Contents
[ ]

The DocumentBuilder provides several overloads of the InsertImage method that allow you to insert an inline or floating image. If the image is an EMF or WMF metafile, it will be inserted into the document in metafile format. All other images will be saved in PNG format.

The following code example shows how to insert an image info a document:

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

builder.insertImage("image.jpg");
doc.save("insertedImage.docx");

See also: