List of usage examples for com.itextpdf.text Anchor Anchor
public Anchor(final float leading, final String string)
Anchor
with a certain leading and a certain String
. From source file:PDFmaker.java
private static void addContent(Document document) throws DocumentException { Anchor anchor = new Anchor("Productielijst", catFont); // anchor.setName("First Chapter"); // Second parameter is the number of the chapter Chapter catPart = new Chapter(new Paragraph(anchor), 0); catPart.add(new Paragraph( "Productielijst gegenereerd door: " + System.getProperty("user.name") + ", " + LocalDate.now(), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ smallBold));/*from ww w . j a v a 2s . c om*/ // 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 // createList(subCatPart); // Paragraph paragraph = new Paragraph(); // addEmptyLine(paragraph, 5); // subCatPart.add(paragraph); // add a table Paragraph paragraph = new Paragraph(); addEmptyLine(paragraph, 1); catPart.add(paragraph); createTable(catPart); // 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); }
From source file:Pdfsave.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 createList(subCatPart);/* ww w . ja v a 2s . c o m*/ Paragraph paragraph = new Paragraph(); addEmptyLine(paragraph, 5); 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); }
From source file:pdf_demo2.java
private static void addContent(Document document) throws DocumentException { Anchor anchor = new Anchor("First Chapter", titleFont); anchor.setName("First Chapter"); // Second parameter is the number of the chapter ex: 1. Chapter 1 or 2. Chapter 2 Chapter chapter = new Chapter(new Paragraph(anchor), 2); Paragraph subPara = new Paragraph("Subcategory 1", subFont); Section subSection = chapter.addSection(subPara); subSection.add(new Paragraph("Hello")); subPara = new Paragraph("Subcategory 2", subFont); subSection = chapter.addSection(subPara); subSection.add(new Paragraph("Paragraph 1")); subSection.add(new Paragraph("Paragraph 2")); subSection.add(new Paragraph("Paragraph 3")); // add a list createList(subSection);// w ww . j a va 2 s . c o m Paragraph paragraph = new Paragraph(); addEmptyLine(paragraph, 5); subSection.add(paragraph); // add a table createTable(subSection); // now add all this to the document document.add(chapter); // Next section anchor = new Anchor("Second Chapter", titleFont); anchor.setName("Second Chapter"); // Second parameter is the number of the chapter chapter = new Chapter(new Paragraph(anchor), 2); subPara = new Paragraph("Subcategory", subFont); subSection = chapter.addSection(subPara); subSection.add(new Paragraph("This is a very important message")); // now add all this to the document document.add(chapter); }
From source file:bl.pdf.PDFFile.java
@SuppressWarnings("unused") private 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 createList(subCatPart);/*from www . j ava2 s .com*/ Paragraph paragraph = new Paragraph(); addEmptyLine(paragraph, 5); 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); }
From source file:bookshopautomationsoftware.GenerateReceipt.java
private static void addContent(Document document) throws DocumentException { Anchor anchor = new Anchor("BILL DETAILS(Generated by BAS) on " + new Date(), 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("CUSTOMER BILL", subFont); Section subCatPart = catPart.addSection(subPara); addEmptyLine(preface, 2);// w w w . j a v a2 s. c o m // add a table createTable(subCatPart); Paragraph subPara2 = new Paragraph("Thanks for choosing us .. please visit again", subFont); Section subCatPart2 = catPart.addSection(subPara2); /* Anchor anchor2 = new Anchor("Thanks for choosing us .. please visit again", catFont); Chapter catPart2 = new Chapter(new Paragraph(anchor), 1);*/ // now add all this to the document document.add(catPart); //document.add(catPart2); }
From source file:bsf.conn.DBMS.java
private static void addContent(Document document) throws DocumentException { Anchor anchor = new Anchor("Personal Info", catFont); anchor.setName("Personal Info"); // Second parameter is the number of the chapter Chapter catPart = new Chapter(new Paragraph(anchor), 1); Paragraph subPara = new Paragraph(null, smallBold); Section subCatPart = catPart.addSection(subPara); // add a table subPara.setAlignment(Element.ALIGN_LEFT); createTable(subCatPart, info.personalInfo); // now add all this to the document document.add(catPart);/*ww w . j a va 2s .c om*/ // Next section anchor = new Anchor("Personal Information", catFont); anchor.setName("Personal Information"); // Second parameter is the number of the chapter catPart = new Chapter(new Paragraph(anchor), 1); subPara = new Paragraph("Running Details", smallBold); subPara.setAlignment(Element.ALIGN_LEFT); subCatPart = catPart.addSection(subPara); // add a table addEmptyLine(subPara, 3); createTable(subCatPart, info.runningDetails); // now add all this to the document document.add(catPart); // Next section anchor = new Anchor("Personal Information", catFont); anchor.setName("Personal Information"); // Thrd parameter is the number of the chapter catPart = new Chapter(new Paragraph(anchor), 1); subPara = new Paragraph("Leave Details", smallBold); subCatPart = catPart.addSection(subPara); // add a table addEmptyLine(subPara, 3); subPara.setAlignment(Element.ALIGN_LEFT); createTable(subCatPart, info.leaveDetails); // now add all this to the document document.add(catPart); // Next section anchor = new Anchor("Family Information", catFont); anchor.setName("Family Information"); // Fourth parameter is the number of the chapter catPart = new Chapter(new Paragraph(anchor), 1); subPara = new Paragraph(null, smallBold); subCatPart = catPart.addSection(subPara); // add a table subPara.setAlignment(Element.ALIGN_LEFT); addEmptyLine(subPara, 3); createTable(subCatPart, info.familyInfo); // now add all this to the document document.add(catPart); // Next section anchor = new Anchor("Course Information", catFont); anchor.setName("Course Information"); // Fifth parameter is the number of the chapter catPart = new Chapter(new Paragraph(anchor), 1); subPara = new Paragraph(null, smallBold); subCatPart = catPart.addSection(subPara); // add a table subPara.setAlignment(Element.ALIGN_LEFT); addEmptyLine(subPara, 3); createTable(subCatPart, info.courseDetails); // now add all this to the document document.add(catPart); }
From source file:com.auskeny.ems.print.PdfCreator.java
public 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 createList(subCatPart);//from www .j a v a 2 s . co m Paragraph paragraph = new Paragraph(); addEmptyLine(paragraph, 5); 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); }
From source file:com.bazzar.base.service.impl.CreateInvoicePDF.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 createList(subCatPart);/*from w ww. j av a 2 s . co m*/ Paragraph paragraph = new Paragraph(); addEmptyLine(paragraph, 5); 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); }
From source file:com.debashubham.dumpy.ChainageCalcActivity.java
private void addContent(Document document) throws DocumentException { Anchor anchor = new Anchor("Survey Report", catFont); anchor.setName("SurveyReport"); // Second parameter is the number of the chapter Chapter catPart = new Chapter(new Paragraph(anchor), 1); Paragraph subPara = new Paragraph("Entries:", subFont); Section subCatPart = catPart.addSection(subPara); Paragraph paragraph = new Paragraph(); addEmptyLine(paragraph, 5);/*from ww w .j a v a 2 s .c o m*/ subCatPart.add(paragraph); // add a table createTable(subCatPart); // now add all this to the document document.add(catPart); }
From source file:com.equiworx.util.Main.java
private static void addContent(Document document) throws DocumentException { Anchor anchor = new Anchor("ESTIMATING APP", catFont); anchor.setName("ESTIMATING APP"); // 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 createList(subCatPart);//from ww w. j a v a 2 s.c o m Paragraph paragraph = new Paragraph(); addEmptyLine(paragraph, 5); 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); }