ApiExamples.ExPageSetup.ColumnsCustomWidth C# (CSharp) Метод

ColumnsCustomWidth() приватный Метод

private ColumnsCustomWidth ( ) : void
Результат void
        public void ColumnsCustomWidth()
        {
            //ExStart
            //ExFor:TextColumnCollection.LineBetween
            //ExFor:TextColumnCollection.EvenlySpaced
            //ExFor:TextColumnCollection.Item
            //ExFor:TextColumn
            //ExFor:TextColumn.Width
            //ExFor:TextColumn.SpaceAfter
            //ExSummary:Creates multiple columns of different widths in a section using DocumentBuilder.
            DocumentBuilder builder = new DocumentBuilder();

            TextColumnCollection columns = builder.PageSetup.TextColumns;
            // Show vertical line between columns.
            columns.LineBetween = true;
            // Indicate we want to create column with different widths.
            columns.EvenlySpaced = false;
            // Create two columns, note they will be created with zero widths, need to set them.
            columns.SetCount(2);

            // Set the first column to be narrow.
            TextColumn c1 = columns[0];
            c1.Width = 100;
            c1.SpaceAfter = 20;

            // Set the second column to take the rest of the space available on the page.
            TextColumn c2 = columns[1];
            PageSetup ps = builder.PageSetup;
            double contentWidth = ps.PageWidth - ps.LeftMargin - ps.RightMargin;
            c2.Width = contentWidth - c1.Width - c1.SpaceAfter;

            builder.Writeln("Narrow column 1.");
            builder.InsertBreak(BreakType.ColumnBreak);
            builder.Writeln("Wide column 2.");

            builder.Document.Save(MyDir + @"\Artifacts\PageSetup.ColumnsCustomWidth.doc");
            //ExEnd
        }