Aspose.Plugins.AsposeVSOpenXML.Program.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
            //ExFor:Shape.LastParagraph
            //ExId:RenderParagraphToImage
            //ExSummary:Shows how to render a paragraph with a custom background color independent of the document. 
            // Retrieve the first paragraph in the main shape.
            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;

            RenderNode(paragraph, dataDir + "TestFile.RenderParagraph Out.png", options);
            //ExEnd
        }