Package com.lowagie.text

Examples of com.lowagie.text.Chapter


      if (list == null) {
        document.add(new Paragraph("This document has no bookmarks."));
      }
      else {
        for (HashMap<String, Object> c: list) {
          Chapter chapter = (Chapter)createBookmark(src.getName(), null, c);
          List<HashMap<String, Object>> kids = (List<HashMap<String, Object>>) c.get("Kids");
          if (kids != null) {
            for (HashMap<String, Object> m: kids) {
              addBookmark(src.getName(), chapter, m);
            }
View Full Code Here


      }
      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 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

            // then automatically set for all Chapters.
            document.setFooter(new HeaderFooter(new LwgPhrase("This is page "), new LwgPhrase(".")));
           
            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(LwgElement.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(LwgElement.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 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(LwgElement.ALIGN_JUSTIFIED);
                    blahblah.setAlignment(LwgElement.ALIGN_JUSTIFIED);
                    chapter.add(blahblah);
                }
                // in chapter 5, the alignment is changed again
                if (i == 5) {
                    blahblahblah.setAlignment(LwgElement.ALIGN_CENTER);
                    blahblah.setAlignment(LwgElement.ALIGN_RIGHT);
                    chapter.add(blahblah);
                }
                // the alignment is changed to ALIGN_JUSTIFIED again
                if (i == 6) {
                    blahblahblah.setAlignment(LwgElement.ALIGN_JUSTIFIED);
                    blahblah.setAlignment(LwgElement.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

      }
      else {
        HashMap c;
        for (Iterator i = list.iterator(); i.hasNext(); ) {
          c = (HashMap) i.next();
          Chapter chapter = (Chapter)createBookmark(src.getName(), null, c);
          ArrayList kids = (ArrayList) c.get("Kids");
          if (kids != null) {
            for (Iterator k = kids.iterator(); k.hasNext(); ) {
              addBookmark(src.getName(), chapter, (HashMap)k.next());
            }
View Full Code Here

      }
      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

      Integer key = itr.next();
      String yTitle = (String) inMap.get(key);
      int indexVal = key.intValue();
      String chartTitle = yTitle + " Vs. Time";
      Phrase phrase = new Phrase(chartTitle.toUpperCase(), font);
      Chapter chapter = new Chapter(new Paragraph(phrase), (cnt - 1));
      BufferedImage image =
          PlotGraphs.createXYTimeImage(zp._fpd,
                                       1,
                                       new int[] { indexVal },
                                       chartTitle,
View Full Code Here

      if (list == null) {
        document.add(new Paragraph("This document has no bookmarks."));
      }
      else {
        for (HashMap<String, Object> c: list) {
          Chapter chapter = (Chapter)createBookmark(src.getName(), null, c);
          List<HashMap<String, Object>> kids = (List<HashMap<String, Object>>) c.get("Kids");
          if (kids != null) {
            for (HashMap<String, Object> m: kids) {
              addBookmark(src.getName(), chapter, m);
            }
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.