List of usage examples for com.itextpdf.text Chapter addSection
public Section addSection(final Paragraph title)
Section
, adds it to this Section
and returns it. From source file:tn.com.hitechart.eds.Util.pdfRpport.FirstPdf.java
private void addContent(Document document) throws DocumentException { // Second parameter is the number of the chapter Phrase phrase = new Phrase("", catFontblanc); phrase.add(""); Chapter catPart = new Chapter(new Paragraph(phrase), 0); Chapter catParttask = new Chapter(new Paragraph(phrase), 0); Paragraph p = new Paragraph("", catFontblanc); Section subCatPart = catPart.addSection(p); // subCatPart.add(new Paragraph("Hello1111111111111111111111 "+user.getLogin())); //subPara = new Paragraph("Subcategory 22222222222222 "+pointage.getDate_timeInM(), subFont); //subCatPart = catPart.addSection(subPara); //subCatPart.add(new Paragraph("Paragraph 1")); //subCatPart.add(new Paragraph("Paragraph 2")); //subCatPart.add(new Paragraph("Paragraph 3")); // add a list //createList(subCatPart); //Paragraph paragraph = new Paragraph(); //addEmptyLine(paragraph, 5); //subCatPart.add(paragraph); // add a table createTable(subCatPart);/*from w ww. j a va 2 s . co m*/ // now add all this to the document document.add(catPart); //document.add(catParttask); // Next section // anchor = new Anchor("Second Chapter", catFont); //anchor.setName("Second Chapter"); // Second parameter is the number of the chapter //catPart = new Chapter(new Paragraph(anchor), 1); //subPara = new Paragraph("Subcategory", subFont); //subCatPart = catPart.addSection(subPara); //subCatPart.add(new Paragraph("This is a very important message")); // now add all this to the document //document.add(catPart); }
From source file:uk.ac.openmf.utils.OpenMFPDFGenerator.java
public static void addContent(Document document, String title, String clientId) throws DocumentException { Anchor anchor = new Anchor(title, catFont); anchor.setName(title);//from ww w.j a v a 2 s . c o m // Second parameter is the number of the chapter Chapter catPart = new Chapter(new Paragraph(anchor), 1); Paragraph subPara = new Paragraph("Loan Account Overview", catFont); addEmptyLine(subPara, 1); Section subCatPart = catPart.addSection(subPara); // add a table createLAOTable(subCatPart, clientId); Paragraph subPara1 = new Paragraph("Savings Account Overview", catFont); addEmptyLine(subPara1, 1); Section subCatPart1 = catPart.addSection(subPara1); // add a table createSAOTable(subCatPart1, clientId); // now add all this to the document document.add(catPart); }
From source file:uk.ac.openmf.utils.OpenMFPDFGenerator.java
public static void addTaskContent(Document document, String title, String omfuId) throws DocumentException { Anchor anchor = new Anchor(title, catFont); anchor.setName(title);//ww w .ja v a 2s . c o m // Second parameter is the number of the chapter Chapter catPart = new Chapter(new Paragraph(anchor), 1); Paragraph subPara = new Paragraph("User Tasks Overview", catFont); addEmptyLine(subPara, 1); Section subCatPart = catPart.addSection(subPara); // add a table createTasksTable(subCatPart, omfuId); // now add all this to the document document.add(catPart); }
From source file:wtw.ui.GeneratingPdfAction.java
private static void addContent(Document document) throws DocumentException { Anchor anchor = new Anchor("First Chapter", catFont); anchor.setName("First Chapter"); // Second parameter is the number of the chapter Chapter catPart = new Chapter(new Paragraph(anchor), 1); Paragraph subPara = new Paragraph("Subcategory 1", subFont); Section subCatPart = catPart.addSection(subPara); subCatPart.add(new Paragraph("Hello")); subPara = new Paragraph("Subcategory 2", subFont); subCatPart = catPart.addSection(subPara); subCatPart.add(new Paragraph("Paragraph 1")); subCatPart.add(new Paragraph("Paragraph 2")); subCatPart.add(new Paragraph("Paragraph 3")); // Add a list Paragraph paragraph = new Paragraph(); addEmptyLine(paragraph, 5);/* ww w . j av a 2s. c o m*/ subCatPart.add(paragraph); // Add a table createTable(subCatPart); // Now add all this to the document document.add(catPart); // Next section anchor = new Anchor("Second Chapter", catFont); anchor.setName("Second Chapter"); // Second parameter is the number of the chapter catPart = new Chapter(new Paragraph(anchor), 1); subPara = new Paragraph("Subcategory", subFont); subCatPart = catPart.addSection(subPara); subCatPart.add(new Paragraph("This is a very important message")); // Now add all this to the document document.add(catPart); }