We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to export Diagram into image and Word document?

Platform: WinForms |
Control: Diagram |
Published Date: April 30, 2011 |
Last Revised Date: June 3, 2019


Essential diagram allows to export the diagram to word document and to image.

  • Exporting as Image can be achieved by using Diagram.ExportDiagramAsImage() and saving as Image.
  • Exporting into Word document can be achieved by saving the diagram in standard image formats such as bitmaps, enhanced metafiles , SVG format files and these images can be exported to word document using Essential DocIO. For this it is neccessary to have Essential DocIO to be installed.

Exporting as Image


ImageFormat imgformat = ImageFormat.Bmp;
Image img = this.diagram1.View.ExportDiagramAsImage(true);
img.Save("MyDiagram.bmp", imgformat);



Dim imgformat As ImageFormat = ImageFormat.Bmp
Dim img As Image = Me.diagram1.View.ExportDiagramAsImage(True)
img.Save("MyDiagram.bmp", imgformat)


Exporting into Word Document


System.Drawing.Image diagramimage = new Bitmap(1, 1, PixelFormat.Format24bppRgb);
Graphics grfx = Graphics.FromImage(diagramimage);
IntPtr hdc = grfx.GetHdc();
Metafile emf = new Metafile(hdc, EmfType.EmfOnly);
Graphics emfgrfx = Graphics.FromImage(emf);
WordDocument document = new WordDocument();
//Adding a new section to the document.
IWSection section = document.AddSection();
//Adding a paragraph to the section
IWParagraph paragraph = section.AddParagraph();
WPicture mImage = (WPicture)paragraph.AppendPicture(emf);
document.Save("Sample.doc", Syncfusion.DocIO.FormatType.Doc);



Dim diagramimage As System.Drawing.Image = New Bitmap(1, 1, PixelFormat.Format24bppRgb)
Dim grfx As Graphics = Graphics.FromImage(diagramimage)
Dim hdc As IntPtr = grfx.GetHdc()
Dim emf As Metafile = New Metafile(hdc, EmfType.EmfOnly)
Dim emfgrfx As Graphics = Graphics.FromImage(emf)
Dim document As WordDocument = New WordDocument()
'Adding a new section to the document.
Dim section As IWSection = document.AddSection()
'Adding a paragraph to the section
Dim paragraph As IWParagraph = section.AddParagraph()
Dim mImage As WPicture = CType(paragraph.AppendPicture(emf), WPicture)
document.Save("Sample.doc", Syncfusion.DocIO.FormatType.Doc)


Sample :


2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile