//// This code is part of Document Solutions for Word demos.// Copyright (c) MESCIUS inc. All rights reserved.//usingSystem.IO;usingSystem.Xml;usingGrapeCity.Documents.Word; namespaceDsWordWeb.Demos{// This sample shows how to load an existing ink XML// and create an InkShape with the loaded ink as content.publicclassInkXml {publicGcWordDocumentCreateDocx() {GcWordDocument doc = newGcWordDocument(); // Load the ink XML and add it as an ink shape to the DOCX:var inkXml = newXmlDocument(); inkXml.Load(Path.Combine("Resources", "Misc", "ink.xml"));var ink = doc.Body.Paragraphs.Add("Paragraph containing the ink shape.").GetRange().Runs.Add().GetRange().InkShapes.Add(inkXml);// Modify the ink's size and angle: ink.WrapFormat.Type = WrapType.Square; ink.Size.Width.Relative = 40; ink.Size.Width.RelativeTo = SizeRelativeHorizontally.Margin; ink.Size.Height.Relative = 30; ink.Size.Height.RelativeTo = SizeRelativeVertically.Margin; ink.Rotation.Angle = 30; // Add a paragraph after the one containing the ink: doc.Body.Paragraphs.Add("This paragraph is added after the ink shape loaded from an XML. " +$"The ink shape's wrap type is set to {ink.WrapFormat.Type} " +$"and the shape is rotated {ink.Rotation.Angle} degrees clockwise. " +$"The width is {ink.Size.Width.Relative}% relative to page width sans the margins, " +$"and the height is {ink.Size.Height.Relative}% relative to page height sans the margins."); // Done:return doc; } }}