Package com.itextpdf.text

Examples of com.itextpdf.text.Chapter


    document.add(preface);
    document.newPage();
  }

  private void addContent(Document document) throws DocumentException {
    Chapter catPart=null;
    int k=1;
    for(int j=0; j<a.size(); j++){
      if (!a.get(j).equals(new ArrayList<String>())){
    Anchor anchor = new Anchor(a.get(j).get(0).toString(), catFont);
    anchor.setName(a.get(j).get(0).toString());
    catPart = new Chapter(new Paragraph(anchor), k);

    Paragraph subPara = new Paragraph("Prononciation: ", subFont);
    Section subCatPart = catPart.addSection(subPara);
    subCatPart.add(new Paragraph(a.get(j).get(1).toString()));

    subPara = new Paragraph("Nature: ", subFont);
    subCatPart = catPart.addSection(subPara);
    subCatPart.add(new Paragraph(a.get(j).get(2).toString()));
 
    subPara = new Paragraph("D�finition: ", subFont);
    subCatPart = catPart.addSection(subPara);
    subCatPart.add(new Paragraph(a.get(j).get(3).toString()));
    document.add(catPart);

      k++;
      }
View Full Code Here


    String domainTitle = domain.getName();
    // 域标题
    Paragraph pDomainTitle = new Paragraph(domainTitle, Fonts.FONT_TITILE1);
    pDomainTitle.setAlignment(Paragraph.ALIGN_CENTER);
    // 章节
    Chapter cDomainChapter = new Chapter(domainTitle, chapterIndex++);
    // 编号深度
    cDomainChapter.setNumberDepth(0);
    // 必须添加一个Section。Chapter不会产生目录!!(会产生目录,只有一章的时候阅读器默认隐藏了而已!)
    // Section section = cDomainChapter.addSection(pDomainTitle);
    // 分割线
    LineSeparator line = new LineSeparator(2f, 100, BaseColor.BLACK,
        Element.ALIGN_CENTER, -5f);
View Full Code Here

TOP

Related Classes of com.itextpdf.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.