-2

I tried do like this Inserting Image into DocX using OpenXML and setting the size but I not found the reference of "new BitmapImage"

I'am using framework .NET 4.5 on Visual Studio 2013 in ASP.NET MVC Application

Community
  • 1
  • 1
Duan Brito
  • 15
  • 6

1 Answers1

0

Have a look at this : MSDN Basically you have to use this: Notice the ImagePartType

MainDocumentPart mainPart = wordprocessingDocument.MainDocumentPart;
ImagePart imagePart = mainPart.AddImagePart(ImagePartType.Jpeg);
using (FileStream stream = new FileStream(fileName, FileMode.Open))
{
   imagePart.FeedData(stream);
}
AddImageToBody(wordprocessingDocument, mainPart.GetIdOfPart(imagePart));
Oualid KTATA
  • 1,116
  • 10
  • 20