'''' This code is part of Document Solutions for Word demos.'' Copyright (c) MESCIUS inc. All rights reserved.''ImportsSystem.IOImportsSystem.DiagnosticsImportsGrapeCity.Documents.Word '' This demo shows how to add an SVG image to am MS Word DOCX document.PublicClassAddSvgFunctionCreateDocx() AsGcWordDocumentDim doc = NewGcWordDocument()Dim par = doc.Body.AddParagraph("The picture below is produced by a vector SVG image added to the document. " +"Mimicking the MS Word behavior, when an SVG is added, DsWord also creates a fallback raster version of the image.") Dim pic = doc.Body.AddParagraph().AddRun().AddPicture()'' Load picture data:Dim picBytes = File.ReadAllBytes(Path.Combine("Resources", "SVG", "Smiling-Girl.svg")) pic.ImageData.SetImage(picBytes, "image/svg+xml") '' In a debug configuration this shows that both vector and raster image versions are present:Debug.Assert(pic.ImageData.ImageBytesIsNotNothing)Debug.Assert("image/png" = pic.ImageData.ContentType)Debug.Assert(pic.ImageData.ComplementaryVectorDataIsNotNothing)Debug.Assert(pic.ImageData.ComplementaryVectorData.ImageBytes.Length > 0)Debug.Assert("image/svg+xml" = pic.ImageData.ComplementaryVectorData.ContentType) '' Specify the picture size: pic.Size.Width.Value = 200 pic.Size.Height.Value = 400 doc.Body.AddParagraph("The End.") '' Done:Return docEndFunctionEndClass