com.cete.dynamicpdf.pageelements
Class OrderedList




Examples Description
Example 1 This example shows how to create OrderedList.
Example 2 This example shows you how to use the getOverFlowList object for OrderedList to allow text of variable length to flow onto new pages as needed.
Example 3 This example shows you how to use the GetOverFlowList object for OrderedList With x,y Coordinates to allow text of variable length to flow onto new pages as needed.



Example 1: The following example shows how to create OrderedList.

Example.

The following example will display text on the page.

import com.cete.dynamicpdf.*;
import com.cete.dynamicpdf.pageelements.*;
 
 public class MyClass{
      public static void main(String args[]) {
        // Create a PDF Document.
        Document doc = new Document();
        
        // Create a Page.
        Page page1 = new Page();
        
        // Create a OrderedList.
        OrderedList list = new OrderedList(50,120,300,500);
        
        list.setListItemTopMargin(5);
        list.setListItemBottomMargin(5);
        list.setBulletPrefix("(");
        list.setBulletSuffix( ")" );
        list.setTextColor(RgbColor.getHotPink());
        Label label1 = new Label("CeTe Software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF product line allows you to dynamically generate PDF documents, merge PDF documents and add new content to existing PDF documents from within your applications.",50,50,400,200);
        label1.setAlign( TextAlign.JUSTIFY );
        
        // Add ListItem to the List.
        ListItem item1  = list.getListItems().add(".NET products");
        item1.setUnderline( true );
        ListItem item2  = list.getListItems().add("JAVA products");
        item2.setUnderline( true );
        ListItem item3  = list.getListItems().add("COM products");
        item3.setUnderline(true);
        
        // Add OrderedSubList under ListItem item1
        OrderedSubList subList1 = item1.getSubLists().addOrderedSubList(NumberingStyle.ROMAN_UPPERCASE);
        subList1.setTextColor(RgbColor.getDarkGoldenRod());
        ListItem item4 = subList1.getListItems().add("DynamicPDF Generator for .NET");
        ListItem item5 = subList1.getListItems().add("DynamicPDF Merger for .NET");
        
        OrderedSubList subList2 = item2.getSubLists().addOrderedSubList(NumberingStyle.ROMAN_UPPERCASE);
        subList2.setTextColor( RgbColor.getDarkGoldenRod() );
        ListItem item6 = subList2.getListItems().add("DynamicPDF Generator for JAVA");
        ListItem item7 = subList2.getListItems().add("DynamicPDF Merger for JAVA");
        
        OrderedSubList subList3 = item3.getSubLists().addOrderedSubList(NumberingStyle.ROMAN_UPPERCASE);
        subList3.setTextColor(RgbColor.getDarkGoldenRod());
        ListItem item8 = subList3.getListItems().add("DynamicPDF Generator");
        ListItem item9 = subList3.getListItems().add("DynamicPDF ReportWriter");
        
        OrderedSubList subList4 = item6.getSubLists().addOrderedSubList(NumberingStyle.ALPHABETIC_LOWERCASE);
        subList4.setTextColor( RgbColor.getBlueViolet() );
        ListItem item10 = subList4.getListItems().add("Community Edition");
        ListItem item11 = subList4.getListItems().add("Developer Edition");
        ListItem item12 = subList4.getListItems().add("Server Edition");
        
        OrderedSubList subList5 = item7.getSubLists().addOrderedSubList(NumberingStyle.ALPHABETIC_LOWERCASE);
        subList5.setTextColor( RgbColor.getBlueViolet() );
        ListItem item13 = subList5.getListItems().add("Evaluation Edition");
        ListItem item14 = subList5.getListItems().add("Developer Edition");
        ListItem item15 = subList5.getListItems().add("Server Edition");
        
        OrderedSubList subList6 = item4.getSubLists().addOrderedSubList(NumberingStyle.ALPHABETIC_LOWERCASE);
        subList6.setTextColor( RgbColor.getBlueViolet() );
        ListItem item16 = subList6.getListItems().add("Community Edition");
        ListItem item17 = subList6.getListItems().add("Professional Edition");
        ListItem item18 = subList6.getListItems().add("Enterprise Edition");
        
        OrderedSubList subList7 = item5.getSubLists().addOrderedSubList(NumberingStyle.ALPHABETIC_LOWERCASE);
        subList7.setTextColor(RgbColor.getBlueViolet());
        ListItem item19 = subList7.getListItems().add("Standard Edition");
        ListItem item20 = subList7.getListItems().add("Professional Edition");
        ListItem item21 = subList7.getListItems().add("Enterprise Edition");
        
        // Add the OrderedList to the page
        page1.getElements().add(list);
        page1.getElements().add(label1);
        
        // Add the Page to the Document.
        doc.getPages().add(page1);
        
        // Save the PDF
        doc.draw("[PhysicalPath]/MyDocument.pdf");
    }
 }

Top

Example 2: The following example shows you how to use the getOverFlowList object for OrderedList to allow text of variable length to flow onto new pages as needed.

import com.cete.dynamicpdf.*;
import com.cete.dynamicpdf.pageelements.*;

public class MyClass
{
   public static void main(String args[]) {
        // Create a PDF Document.
        Document doc = new Document();
        
        // Create a Page.
        Page page1 = new Page();
        
        // Create a OrderedList.
        OrderedList list = new OrderedList(50,120,300,500);
        
        list.setListItemTopMargin(5);
        list.setListItemBottomMargin(5);
        list.setBulletPrefix("(");
        list.setBulletSuffix( ")" );
        list.setTextColor(RgbColor.getHotPink());
        Label label1 = new Label("CeTe Software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF product line allows you to dynamically generate PDF documents, merge PDF documents and add new content to existing PDF documents from within your applications.",50,50,400,200);
        label1.setAlign( TextAlign.JUSTIFY );
        
        // Add ListItem to the List.
        ListItem item1  = list.getListItems().add(".NET products");
        item1.setUnderline( true );
        ListItem item2  = list.getListItems().add("JAVA products");
        item2.setUnderline( true );
        ListItem item3  = list.getListItems().add("COM products");
        item3.setUnderline(true);
        
        // Add OrderedSubList under ListItem item1
        OrderedSubList subList1 = item1.getSubLists().addOrderedSubList(NumberingStyle.ROMAN_UPPERCASE);
        subList1.setTextColor(RgbColor.getDarkGoldenRod());
        ListItem item4 = subList1.getListItems().add("DynamicPDF Generator for .NET");
        ListItem item5 = subList1.getListItems().add("DynamicPDF Merger for .NET");
        
        OrderedSubList subList2 = item2.getSubLists().addOrderedSubList(NumberingStyle.ROMAN_UPPERCASE);
        subList2.setTextColor( RgbColor.getDarkGoldenRod() );
        ListItem item6 = subList2.getListItems().add("DynamicPDF Generator for JAVA");
        ListItem item7 = subList2.getListItems().add("DynamicPDF Merger for JAVA");
        
        OrderedSubList subList3 = item3.getSubLists().addOrderedSubList(NumberingStyle.ROMAN_UPPERCASE);
        subList3.setTextColor(RgbColor.getDarkGoldenRod());
        ListItem item8 = subList3.getListItems().add("DynamicPDF Generator");
        ListItem item9 = subList3.getListItems().add("DynamicPDF ReportWriter");
        
        OrderedSubList subList4 = item6.getSubLists().addOrderedSubList(NumberingStyle.ALPHABETIC_LOWERCASE);
        subList4.setTextColor( RgbColor.getBlueViolet() );
        ListItem item10 = subList4.getListItems().add("Community Edition");
        ListItem item11 = subList4.getListItems().add("Developer Edition");
        ListItem item12 = subList4.getListItems().add("Server Edition");
        
        OrderedSubList subList5 = item7.getSubLists().addOrderedSubList(NumberingStyle.ALPHABETIC_LOWERCASE);
        subList5.setTextColor( RgbColor.getBlueViolet() );
        ListItem item13 = subList5.getListItems().add("Evaluation Edition");
        ListItem item14 = subList5.getListItems().add("Developer Edition");
        ListItem item15 = subList5.getListItems().add("Server Edition");
        
        OrderedSubList subList6 = item4.getSubLists().addOrderedSubList(NumberingStyle.ALPHABETIC_LOWERCASE);
        subList6.setTextColor( RgbColor.getBlueViolet() );
        ListItem item16 = subList6.getListItems().add("Community Edition");
        ListItem item17 = subList6.getListItems().add("Professional Edition");
        ListItem item18 = subList6.getListItems().add("Enterprise Edition");
        
        OrderedSubList subList7 = item5.getSubLists().addOrderedSubList(NumberingStyle.ALPHABETIC_LOWERCASE);
        subList7.setTextColor(RgbColor.getBlueViolet());
        ListItem item19 = subList7.getListItems().add("Standard Edition");
        ListItem item20 = subList7.getListItems().add("Professional Edition");
        ListItem item21 = subList7.getListItems().add("Enterprise Edition");
        
        // Add the OrderedList to the page
        page1.getElements().add(list);
        page1.getElements().add(label1);
        
        // Add the Page to the Document.
        doc.getPages().add(page1);
        
        // Set the OrderedList object equal to the rest of the text that did not fit
        // if all the text did fit, GetOverflowList will return null
        list = list.getOverFlowList();
        
        while(list!=null){
            page1= new Page(PageSize.A4);
            page1.getElements().add(list);
            doc.getPages().add(page1);
            list  = list.getOverFlowList();
        }
        
        // Save the PDF
        doc.draw("[PhysicalPath]/MyDocument.pdf");
    }
}

Top

Example 3: The following example shows you how to use the GetOverflowTextArea object With x,y Coordinates to allow text of variable length to flow onto new pages as needed.

import com.cete.dynamicpdf.*;
import com.cete.dynamicpdf.pageelements.*;

public class MyClass
{
   public static void main(String args[]) {
        // Create a PDF Document.
        Document doc = new Document();
        
        // Create a Page.
        Page page1 = new Page();
        
        // Create a OrderedList.
        OrderedList list = new OrderedList(50,120,300,500);
        
        list.setListItemTopMargin(5);
        list.setListItemBottomMargin(5);
        list.setBulletPrefix("(");
        list.setBulletSuffix( ")" );
        list.setTextColor(RgbColor.getHotPink());
        Label label1 = new Label("CeTe Software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF product line allows you to dynamically generate PDF documents, merge PDF documents and add new content to existing PDF documents from within your applications.",50,50,400,200);
        label1.setAlign( TextAlign.JUSTIFY );
        
        // Add ListItem to the List.
        ListItem item1  = list.getListItems().add(".NET products");
        item1.setUnderline( true );
        ListItem item2  = list.getListItems().add("JAVA products");
        item2.setUnderline( true );
        ListItem item3  = list.getListItems().add("COM products");
        item3.setUnderline(true);
        
        // Add OrderedSubList under ListItem item1
        OrderedSubList subList1 = item1.getSubLists().addOrderedSubList(NumberingStyle.ROMAN_UPPERCASE);
        subList1.setTextColor(RgbColor.getDarkGoldenRod());
        ListItem item4 = subList1.getListItems().add("DynamicPDF Generator for .NET");
        ListItem item5 = subList1.getListItems().add("DynamicPDF Merger for .NET");
        
        OrderedSubList subList2 = item2.getSubLists().addOrderedSubList(NumberingStyle.ROMAN_UPPERCASE);
        subList2.setTextColor( RgbColor.getDarkGoldenRod() );
        ListItem item6 = subList2.getListItems().add("DynamicPDF Generator for JAVA");
        ListItem item7 = subList2.getListItems().add("DynamicPDF Merger for JAVA");
        
        OrderedSubList subList3 = item3.getSubLists().addOrderedSubList(NumberingStyle.ROMAN_UPPERCASE);
        subList3.setTextColor(RgbColor.getDarkGoldenRod());
        ListItem item8 = subList3.getListItems().add("DynamicPDF Generator");
        ListItem item9 = subList3.getListItems().add("DynamicPDF ReportWriter");
        
        OrderedSubList subList4 = item6.getSubLists().addOrderedSubList(NumberingStyle.ALPHABETIC_LOWERCASE);
        subList4.setTextColor( RgbColor.getBlueViolet() );
        ListItem item10 = subList4.getListItems().add("Community Edition");
        ListItem item11 = subList4.getListItems().add("Developer Edition");
        ListItem item12 = subList4.getListItems().add("Server Edition");
        
        OrderedSubList subList5 = item7.getSubLists().addOrderedSubList(NumberingStyle.ALPHABETIC_LOWERCASE);
        subList5.setTextColor( RgbColor.getBlueViolet() );
        ListItem item13 = subList5.getListItems().add("Evaluation Edition");
        ListItem item14 = subList5.getListItems().add("Developer Edition");
        ListItem item15 = subList5.getListItems().add("Server Edition");
        
        OrderedSubList subList6 = item4.getSubLists().addOrderedSubList(NumberingStyle.ALPHABETIC_LOWERCASE);
        subList6.setTextColor( RgbColor.getBlueViolet() );
        ListItem item16 = subList6.getListItems().add("Community Edition");
        ListItem item17 = subList6.getListItems().add("Professional Edition");
        ListItem item18 = subList6.getListItems().add("Enterprise Edition");
        
        OrderedSubList subList7 = item5.getSubLists().addOrderedSubList(NumberingStyle.ALPHABETIC_LOWERCASE);
        subList7.setTextColor(RgbColor.getBlueViolet());
        ListItem item19 = subList7.getListItems().add("Standard Edition");
        ListItem item20 = subList7.getListItems().add("Professional Edition");
        ListItem item21 = subList7.getListItems().add("Enterprise Edition");
        
        // Add the OrderedList to the page
        page1.getElements().add(list);
        page1.getElements().add(label1);
        
        // Add the Page to the Document.
        doc.getPages().add(page1);
        
        // Set the OrderedList object equal to the rest of the text that did not fit
        // if all the text did fit, GetOverflowList will return null
        list = list.getOverFlowList(50,50);
        
        while(list!=null){
            page1= new Page(PageSize.A4);
            page1.getElements().add(list);
            doc.getPages().add(page1);
            list  = list.getOverFlowList(50,50);
        }
        
        // Save the PDF
        doc.draw("[PhysicalPath]/MyDocument.pdf");
    }
}

Top