List continue on to next column

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF Merger for .NET (v3 and older)  /  List continue on to next column

DynamicPDF Merger for .NET (v3 and older) Forum

 Oct 23 2012 1:17 PM
I create a list and add unordered and ordered sublists to it to create a long list.  I need a two column document. Is there any way to allow the list to go to the next column and continue until the end? I have looked at the getoverflowrows and columns example but that has it going to the next page when i want it to goto the next column and not sure it will work with lists...

is this possible?
 Oct 25 2012 4:57 AM
Posted by a ceTe Software moderator
Hello,

The version 3 and previous version of DynamicPDF Merger for .NET product does not support OrderdList and UnOrderdedList.

If you are using version 4 and later version of DynamicPDF Merger for .NET product then you can achieve your requirement by setting the desired X and Y positions to the Overflowlist at the time of getting overflow list items using GetOverFlowList and add it to the same page. This will work for you. Below is the sample code for it.

            Document doc = new Document();
            Page page1 = new Page();
            OrderedList list = new OrderedList(0, 0, 300, page1.Dimensions.Body.Height);
            list.ListItemTopMargin = 5;
            list.ListItemBottomMargin = 5;
            list.BulletPrefix = "(";
            list.BulletSuffix = ")";
            list.TextColor = RgbColor.HotPink;
          
            ListItem item1 = list.Items.Add("Main List");
            item1.Underline = true;
            for (int i = 0; i < 100; i++)
            {
                // Add OrderedSubList under ListItem item1
                OrderedSubList subList1 = item1.SubLists.AddOrderedSubList(NumberingStyle.None);
                subList1.BulletAlign = Align.Left;
                subList1.TextColor = RgbColor.DarkGoldenRod;
                ListItem item4 = subList1.Items.Add("sublist "+(i+1));
                
            }
            //Adding list to the page.
            do
            {
                list.X = 0;
                list.Y = 0;
                Page page = new Page();
                doc.Pages.Add(page);
                page.Elements.Add(list);
                list = list.GetOverFlowList(350, 0);
                if(list != null)
                {
                    page.Elements.Add(list);
                    list = list.GetOverFlowList(0, 0);
                }
             }
            while (list != null);
            // Save the PDF
            doc.Draw(@"C:\MyDocument.pdf");

Thanks,
ceTe Software Support Team.

All times are US Eastern Standard time. The time now is 12:12 PM.