Aspose.Words.Examples.CSharp.Rendering_and_Printing.RenderShape.RenderParagraphToImage C# (CSharp) Method

RenderParagraphToImage() public static method

public static RenderParagraphToImage ( string dataDir, Document doc ) : void
dataDir string
doc Document
return void
        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)