Aspose.Words.Examples.CSharp.Programming_Documents.Working_With_Document.DocumentBuilderSetFormatting.SetParagraphFormatting C# (CSharp) Метод

SetParagraphFormatting() публичный статический Метод

public static SetParagraphFormatting ( string dataDir ) : void
dataDir string
Результат void
        public static void SetParagraphFormatting(string dataDir)
        {
            // ExStart:DocumentBuilderSetParagraphFormatting
            Document doc = new Document();
            DocumentBuilder builder = new DocumentBuilder(doc);

            // Set paragraph formatting properties
            ParagraphFormat paragraphFormat = builder.ParagraphFormat;
            paragraphFormat.Alignment = ParagraphAlignment.Center;
            paragraphFormat.LeftIndent = 50;
            paragraphFormat.RightIndent = 50;
            paragraphFormat.SpaceAfter = 25;

            // Output text
            builder.Writeln("I'm a very nice formatted paragraph. I'm intended to demonstrate how the left and right indents affect word wrapping.");
            builder.Writeln("I'm another nice formatted paragraph. I'm intended to demonstrate how the space after paragraph looks like.");

            dataDir = dataDir + "DocumentBuilderSetParagraphFormatting_out.doc";
            doc.Save(dataDir);
            // ExEnd:DocumentBuilderSetParagraphFormatting
            Console.WriteLine("\nParagraph formatting using DocumentBuilder set successfully.\nFile saved at " + dataDir);
        }
        public static void SetTableCellFormatting(string dataDir)