Package com.lowagie.text

Examples of com.lowagie.text.Chapter


      }
      anchor.setReference(remote);
      title.add(anchor);
    }
    if (section == null) {
      s = new Chapter(title, 0);
    }
    else {
      s = section.addSection(title);
    }
    s.setNumberDepth(0);
View Full Code Here


            Paragraph blahblah = new Paragraph("blah blah blah blah blah blah blaah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah");
            Paragraph blahblahblah = new Paragraph("blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blaah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah");
            // this loop will create 7 chapters
            for (int i = 1; i < 8; i++) {
                Paragraph cTitle = new Paragraph("This is chapter " + i, chapterFont);
                Chapter chapter = new Chapter(cTitle, i);
                // in chapter 4 we change the alignment to ALIGN_JUSTIFIED
                if (i == 4) {
                    blahblahblah.setAlignment(Element.ALIGN_JUSTIFIED);
                    blahblah.setAlignment(Element.ALIGN_JUSTIFIED);
                    chapter.add(blahblah);
                }
                // in chapter 5, the alignment is changed again
                if (i == 5) {
                    blahblahblah.setAlignment(Element.ALIGN_CENTER);
                    blahblah.setAlignment(Element.ALIGN_RIGHT);
                    chapter.add(blahblah);
                }
                // the alignment is changed to ALIGN_JUSTIFIED again
                if (i == 6) {
                    blahblahblah.setAlignment(Element.ALIGN_JUSTIFIED);
                    blahblah.setAlignment(Element.ALIGN_JUSTIFIED);
                }
                // in every chapter 3 sections will be added
                for (int j = 1; j < 4; j++) {
                    Paragraph sTitle = new Paragraph("This is section " + j + " in chapter " + i, sectionFont);
                    Section section = chapter.addSection(sTitle, 1);
                    // for chapters > 2, the outine isn't open by default
                    if (i > 2) section.setBookmarkOpen(false);
                    // in all chapters except the 1st one, some extra text is added to section 3
                    if (j == 3 && i > 1) {
                      section.setIndentationLeft(72);
View Full Code Here

            // then automatically set for all Chapters.
            document.setFooter(new HeaderFooter(new Phrase("This is page "), new Phrase(".")));
           
            document.open();
           
            Chapter chapter1 = new Chapter("Chapter 1", 1);
            chapter1.add(new Paragraph("This document has different headers and footers " +
                    " for each chapter."));
            document.add(chapter1);

            // After adding the first chapter set the header for the second chapter.
            header = new Paragraph("Chapter 2");
            header.setAlignment(Element.ALIGN_CENTER);
            document.setHeader(new RtfHeaderFooter(header));

            Chapter chapter2 = new Chapter("Chapter 2", 2);
            chapter2.add(new Paragraph("This is the content of chapter 2."));
            document.add(chapter2);
           
            // After adding the second chapter set the header for the third chapter.
            header = new Paragraph("Chapter 3");
            header.setAlignment(Element.ALIGN_CENTER);
            document.setHeader(new RtfHeaderFooter(header));

            Chapter chapter3 = new Chapter("Chapter 3", 3);
            chapter3.add(new Paragraph("Chapter 3 is very boring."));
            document.add(chapter3);

            document.close();
        } catch (FileNotFoundException fnfe) {
            fnfe.printStackTrace();
View Full Code Here

            Paragraph para = new Paragraph();
            para.add(new RtfTableOfContents("RIGHT CLICK AND HERE AND SELECT \"UPDATE FIELD\" TO UPDATE."));
            document.add(para);

            Paragraph par = new Paragraph("This is some sample content.");
            Chapter chap1 = new Chapter("Chapter 1", 1);
            chap1.add(par);
            Chapter chap2 = new Chapter("Chapter 2", 2);
            chap2.add(par);
            document.add(chap1);
            document.add(chap2);
           
            for(int i = 0; i < 300; i++) {
                if(i == 158) {
View Full Code Here

            list.add(new ListItem("Another one"));
            doc.add(list);

            doc.newPage();

            Chapter chapter = new Chapter(new Paragraph("This is a Chapter"), 1);
            chapter.add(new Paragraph(
                    "This is some text that belongs to this chapter."));
            chapter.add(new Paragraph("A second paragraph. What a surprise."));

            Section section = chapter.addSection(new Paragraph(
                    "This is a subsection"));
            section.add(new Paragraph("Text in the subsection."));

            doc.add(chapter);
View Full Code Here

        FontFactory.HELVETICA, 18, Font.BOLDITALIC,
        new Color(0, 0, 255)));
   

    // ////////标题作为第一章节的的Title
    Chapter chapter1 = new Chapter(title1, 1);
    chapter1.setNumberDepth(0);

  //  document.add(chapter1);

    // //段落1
    document.add(new Paragraph("First page of the document."));
View Full Code Here

TOP

Related Classes of com.lowagie.text.Chapter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.