public static void RenderParagraphToImage(string dataDir, Document doc)
{
// ExStart:RenderParagraphToImage
Shape shape = (Shape)doc.GetChild(NodeType.Shape, 0, true);
Paragraph paragraph = (Paragraph)shape.LastParagraph;
// Save the node with a light pink background.
ImageSaveOptions options = new ImageSaveOptions(SaveFormat.Png);
options.PaperColor = Color.LightPink;
dataDir = dataDir + "TestFile.RenderParagraph_out.png";
RenderNode(paragraph, dataDir, options);
// ExEnd:RenderParagraphToImage
Console.WriteLine("\nParagraph rendered to image successfully.\nFile saved at " + dataDir);
}
public static void FindShapeSizes(Shape shape)