//To run this example code, create a word document called TextWrappingSourceDocumentation.docx with the text [Image] in the document
WordReportsGenerator generator = new WordReportsGenerator(); //Trial Mode
//WordReportsGenerator generator = new WordReportsGenerator("place user name here", "place license key here"); //License Mode
const string sourceDocumentPath = @"Test Documents\TextWrappingSourceDocumentation.docx";
const string outputDocumentPath = "ImageDocumentationTest.docx";
const string imagePath = @"Test Documents\KellermanSoftwareImage.png";
Dictionary<string, ReplacementItem> replacement =
new Dictionary<string, ReplacementItem>
{
{
"[Image]",
new ReplacementItem
{
Value = Image.FromFile(imagePath),
ImageTextWrapping = TextWrapping.Square
}
}
};
generator.GenerateWordReport(sourceDocumentPath,
outputDocumentPath,
replacement);