List of usage examples for com.itextpdf.text Element ALIGN_JUSTIFIED
int ALIGN_JUSTIFIED
To view the source code for com.itextpdf.text Element ALIGN_JUSTIFIED.
Click Source Link
From source file:fr.ybonnel.breizhcamppdf.PdfRenderer.java
License:Apache License
private void createTalksPages(List<Talk> talksToExplain) throws DocumentException, IOException { document.setPageSize(PageSize.A4);/*from w ww.j av a 2 s .c o m*/ document.newPage(); Paragraph paragraph = new Paragraph("Liste des talks"); paragraph.setSpacingAfter(25); paragraph.getFont().setSize(25); paragraph.setAlignment(Element.ALIGN_CENTER); document.add(paragraph); for (TalkDetail talk : Lists.transform(talksToExplain, new Function<Talk, TalkDetail>() { @Override public TalkDetail apply(Talk input) { return TalkService.INSTANCE.getTalkDetail(input); } })) { if (talk == null) { continue; } Paragraph empty = new Paragraph(" "); PdfPTable table = new PdfPTable(1); table.setWidthPercentage(100); table.setKeepTogether(true); table.getDefaultCell().setBorder(Rectangle.NO_BORDER); PdfPCell cell; Chunk titleTalk = new Chunk(talk.getTitle(), talkFontTitle); titleTalk.setLocalDestination("talk" + talk.getId()); float[] withTitle = { 0.05f, 0.95f }; PdfPTable titleWithFormat = new PdfPTable(withTitle); titleWithFormat.getDefaultCell().setBorder(Rectangle.NO_BORDER); titleWithFormat.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE); Image image = AvatarService.INSTANCE.getImage(PdfRenderer.class .getResource("/formats/" + talk.getTalk().getFormat().replaceAll(" ", "") + ".png")); titleWithFormat.addCell(image); titleWithFormat.addCell(new Paragraph(titleTalk)); table.addCell(titleWithFormat); table.addCell(empty); table.addCell(new Paragraph("Salle " + talk.getTalk().getRoom() + " de " + talk.getTalk().getStart() + " " + talk.getTalk().getEnd(), presentFont)); table.addCell(empty); cell = new PdfPCell(); cell.setBorder(0); cell.setHorizontalAlignment(Element.ALIGN_JUSTIFIED); for (Element element : HTMLWorker .parseToList(new StringReader(markdownProcessor.markdown(talk.getDescription())), null)) { if (element instanceof Paragraph) { ((Paragraph) element).setAlignment(Element.ALIGN_JUSTIFIED); } cell.addElement(element); } table.addCell(cell); table.addCell(empty); table.addCell(new Paragraph("Prsent par :", presentFont)); float[] widthSpeaker = { 0.05f, 0.95f }; for (Speaker speaker : talk.getSpeakers()) { PdfPTable speakerWithAvatar = new PdfPTable(widthSpeaker); speakerWithAvatar.getDefaultCell().setBorder(Rectangle.NO_BORDER); speakerWithAvatar.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE); speakerWithAvatar.addCell(AvatarService.INSTANCE.getImage(speaker.getAvatar())); speakerWithAvatar.addCell(new Phrase(speaker.getFullname())); table.addCell(speakerWithAvatar); } table.addCell(empty); table.addCell(empty); document.add(table); } }
From source file:gov.va.cem.eoas.business.FaxArchivesPDF.java
public InputStream generatePDF(FaxRecord data) { SimpleDateFormat newFormat = new SimpleDateFormat("MM/dd/yyyy"); Date curDate = new Date(); String caseIdData = (data.getCaseId() != null) ? data.getCaseId() : ""; String currentDate = new String(newFormat.format(curDate)); String sepDocs = (data.getSepDocs()) ? "X" : ""; String marLicense = (data.getMarLicense()) ? "X" : ""; String adminDecision = (data.getAdminDecision()) ? "X" : ""; String deathCert = (data.getDeathCert()) ? "X" : ""; String divorceDecree = (data.getDivorceDecree()) ? "X" : ""; String otherCheck = (data.getOtherCheck()) ? "X" : ""; String transDate = (data.getTransDate() != null) ? new String(newFormat.format(data.getTransDate())) : ""; String priorLoc = (data.getPriorLoc() != null) ? data.getPriorLoc() : ""; String otherComments = (data.getOtherComments() != null) ? data.getOtherComments() : ""; String remarks = (data.getRemarks() != null) ? data.getRemarks() : ""; String to = data.getTo().getDisplayName(); String fileNo = (data.getFileNo() != null) ? data.getFileNo() : ""; String vetName = (data.getVetName() != null) ? data.getVetName() : ""; String ssnData = (data.getSSN() != null) ? data.getSSN() : ""; String snData = (data.getSN() != null) ? data.getSN() : ""; String farcNo = (data.getFarcNo() != null) ? data.getFarcNo() : ""; String boxNoData = (data.getBoxNo() != null) ? data.getBoxNo() : ""; String faxPages = (data.getFaxPages() != null) ? data.getFaxPages() : ""; ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); Document document = new Document(PageSize.A4, 50, 50, 50, 50); try {//from w ww.j ava2s .com PdfWriter.getInstance(document, outputStream); //Font font1 = new Font(Font.FontFamily.TIMES_ROMAN, 9); Font font2 = new Font(Font.FontFamily.TIMES_ROMAN, 10, Font.BOLD); Font font3 = new Font(Font.FontFamily.TIMES_ROMAN, 11); Font fontBold = new Font(Font.FontFamily.TIMES_ROMAN, 11, Font.BOLD); //Font fontUnderline = new Font(Font.FontFamily.TIMES_ROMAN, 11, Font.UNDERLINE); Font fontHeader = new Font(Font.FontFamily.TIMES_ROMAN, 12, Font.BOLD); document.open(); String dirPath = FacesContext.getCurrentInstance().getExternalContext() .getInitParameter("image_file_path"); // Check servlet context for invalid character if (dirPath.contains("..")) throw new IllegalArgumentException( "Servlet context contains invalid character(s). Security may have been compromised."); File dir = new File(dirPath); Image image = Image.getInstance(dir + "/ArchiveFaxHeader.jpg"); image.scalePercent(69, 66); document.add(image); // Create first table float[] colsWidthTo = { .3f, 2f, .4f, 2f }; PdfPTable addressTable = new PdfPTable(colsWidthTo); addressTable.setWidthPercentage(100); PdfPCell toLabel = new PdfPCell(new Phrase("TO:", fontBold)); toLabel.setRowspan(3); toLabel.setBorderWidthRight(0); addressTable.addCell(toLabel); PdfPCell toName = new PdfPCell(new Phrase(to, fontBold)); toName.setBorderWidthLeft(0); toName.setBorderWidthBottom(0); addressTable.addCell(toName); PdfPCell fromLabel = new PdfPCell(new Phrase("FROM:", fontBold)); fromLabel.setBorderWidthRight(0); fromLabel.setBorderWidthBottom(0); addressTable.addCell(fromLabel); PdfPCell fromName = new PdfPCell(new Phrase("Eligibility Case Manager", fontBold)); fromName.setBorderWidthBottom(0); fromName.setBorderWidthLeft(0); addressTable.addCell(fromName); PdfPCell toAddress = new PdfPCell(new Phrase("", fontBold)); toAddress.setBorderWidthLeft(0); toAddress.setBorderWidthTop(0); addressTable.addCell(toAddress); PdfPCell fromDateLabel = new PdfPCell(new Phrase("DATE:", fontBold)); fromDateLabel.setBorderWidthRight(0); fromDateLabel.setBorderWidthTop(0); //toLabel.setRowspan(2); addressTable.addCell(fromDateLabel); PdfPCell dateFrom = new PdfPCell(new Phrase(currentDate, fontBold)); dateFrom.setBorderWidthTop(0); dateFrom.setBorderWidthLeft(0); addressTable.addCell(dateFrom); addressTable.setSpacingBefore(15); addressTable.setSpacingAfter(15); document.add(addressTable); float[] colsWidthCaseId = { .7f, 3f }; PdfPTable caseTable = new PdfPTable(colsWidthCaseId); caseTable.setWidthPercentage(100); PdfPCell caseIdLabel = new PdfPCell(new Phrase("Eligibility Case Id:", font3)); caseIdLabel.setBorderWidth(0); caseTable.addCell(caseIdLabel); PdfPCell caseIdInput = new PdfPCell(new Phrase(caseIdData, font3)); caseIdInput.setBorderWidth(0); caseTable.addCell(caseIdInput); caseTable.setSpacingAfter(8); document.add(caseTable); float[] colsWidthFolder = { .5f, 3f }; PdfPTable folderTable = new PdfPTable(colsWidthFolder); folderTable.setWidthPercentage(100); PdfPCell folderLabel = new PdfPCell(new Phrase("VA file No:", font3)); folderLabel.setBorderWidth(0); folderTable.addCell(folderLabel); PdfPCell folder = new PdfPCell(new Phrase(fileNo, font3)); folder.setBorderWidth(0); folderTable.addCell(folder); folderTable.setSpacingAfter(8); document.add(folderTable); float[] colsWidthRef = { .7f, 3f }; PdfPTable refTable = new PdfPTable(colsWidthRef); refTable.setWidthPercentage(100); PdfPCell ref = new PdfPCell(new Phrase("Veteran's Name:", font3)); ref.setBorderWidth(0); refTable.addCell(ref); PdfPCell refName = new PdfPCell(new Phrase(vetName, font3)); refName.setBorderWidth(0); refTable.addCell(refName); refTable.setSpacingAfter(8); document.add(refTable); float[] colsWidthSSN = { .3f, 2f, .25f, 2f }; PdfPTable ssnTable = new PdfPTable(colsWidthSSN); ssnTable.setWidthPercentage(100); PdfPCell ssnLabel = new PdfPCell(new Phrase("SSN:", font3)); ssnLabel.setBorderWidth(0); ssnTable.addCell(ssnLabel); PdfPCell ssn = new PdfPCell(new Phrase(ssnData, font3)); ssn.setBorderWidth(0); ssnTable.addCell(ssn); PdfPCell snLabel = new PdfPCell(new Phrase("SN:", font3)); snLabel.setBorderWidth(0); ssnTable.addCell(snLabel); PdfPCell sn = new PdfPCell(new Phrase(snData, font3)); sn.setBorderWidth(0); ssnTable.addCell(sn); ssnTable.setSpacingAfter(8); document.add(ssnTable); float[] colsWidthFARC = { .6f, 2f, .8f, 2f }; PdfPTable farcTable = new PdfPTable(colsWidthFARC); farcTable.setWidthPercentage(100); PdfPCell farcLabel = new PdfPCell(new Phrase("FARC No:", font3)); farcLabel.setBorderWidth(0); farcTable.addCell(farcLabel); PdfPCell farc = new PdfPCell(new Phrase(farcNo, font3)); farc.setBorderWidth(0); farcTable.addCell(farc); PdfPCell farcDateLabel = new PdfPCell(new Phrase("Transfer Date:", font3)); farcDateLabel.setBorderWidth(0); farcTable.addCell(farcDateLabel); PdfPCell farcDate = new PdfPCell(new Phrase(transDate, font3)); farcDate.setBorderWidth(0); farcTable.addCell(farcDate); farcTable.setSpacingAfter(8); document.add(farcTable); float[] colsWidthLoc = { .8f, 2f, .6f, 2f }; PdfPTable locTable = new PdfPTable(colsWidthLoc); locTable.setWidthPercentage(100); PdfPCell locLabel = new PdfPCell(new Phrase("Prior Location:", font3)); locLabel.setBorderWidth(0); locTable.addCell(locLabel); PdfPCell location = new PdfPCell(new Phrase(priorLoc, font3)); location.setBorderWidth(0); locTable.addCell(location); PdfPCell boxNoLabel = new PdfPCell(new Phrase("Box No:", font3)); boxNoLabel.setBorderWidth(0); locTable.addCell(boxNoLabel); PdfPCell boxNo = new PdfPCell(new Phrase(boxNoData, font3)); boxNo.setBorderWidth(0); locTable.addCell(boxNo); locTable.setSpacingAfter(8); document.add(locTable); float[] colsWidthRemarks = { .6f, 5f }; PdfPTable remarks1Table = new PdfPTable(colsWidthRemarks); remarks1Table.setWidthPercentage(100); PdfPCell remark1Label = new PdfPCell(new Phrase("Remarks:", font3)); remark1Label.setBorderWidth(0); remarks1Table.addCell(remark1Label); PdfPCell remarks1Input = new PdfPCell(new Phrase( "Please provide copy(ies) of the following document(s) to establish eligibility for burial in a national cemetery.", font3)); remarks1Input.setBorderWidth(0); remarks1Table.addCell(remarks1Input); remarks1Table.setSpacingAfter(8); document.add(remarks1Table); float[] colsWidthDocs = { .4f, 2f, .4f, 2f }; PdfPTable docsTable = new PdfPTable(colsWidthDocs); docsTable.setWidthPercentage(100); PdfPCell docsLabel = new PdfPCell(new Phrase(sepDocs, font3)); docsLabel.setHorizontalAlignment(Element.ALIGN_CENTER); docsLabel.setBorderWidth(0); docsLabel.setBorderWidthBottom(1); docsTable.addCell(docsLabel); PdfPCell docs1 = new PdfPCell(new Phrase("Separation Document(s)", font3)); docs1.setBorderWidth(0); docsTable.addCell(docs1); PdfPCell docs2 = new PdfPCell(new Phrase(deathCert, font3)); docs2.setHorizontalAlignment(Element.ALIGN_CENTER); docs2.setBorderWidth(0); docs2.setBorderWidthBottom(1); docsTable.addCell(docs2); PdfPCell docs3 = new PdfPCell(new Phrase("Death Certificate", font3)); docs3.setBorderWidth(0); docsTable.addCell(docs3); PdfPCell docs4 = new PdfPCell(new Phrase(marLicense, font3)); docs4.setHorizontalAlignment(Element.ALIGN_CENTER); docs4.setBorderWidth(0); docs4.setBorderWidthBottom(1); docsTable.addCell(docs4); PdfPCell docs5 = new PdfPCell(new Phrase("Marriage License", font3)); docs5.setBorderWidth(0); docsTable.addCell(docs5); PdfPCell docs6 = new PdfPCell(new Phrase(divorceDecree, font3)); docs6.setHorizontalAlignment(Element.ALIGN_CENTER); docs6.setBorderWidth(0); docs6.setBorderWidthBottom(1); docsTable.addCell(docs6); PdfPCell docs7 = new PdfPCell(new Phrase("Divorce Decree", font3)); docs7.setBorderWidth(0); docsTable.addCell(docs7); PdfPCell docs8 = new PdfPCell(new Phrase(adminDecision, font3)); docs8.setHorizontalAlignment(Element.ALIGN_CENTER); docs8.setBorderWidth(0); docs8.setBorderWidthBottom(1); docsTable.addCell(docs8); PdfPCell docs9 = new PdfPCell(new Phrase("VA Admin Decision", font3)); docs9.setBorderWidth(0); docsTable.addCell(docs9); PdfPCell docs10 = new PdfPCell(new Phrase("", font3)); docs10.setBorderWidth(0); docsTable.addCell(docs10); PdfPCell docs11 = new PdfPCell(new Phrase("", font3)); docs11.setBorderWidth(0); docsTable.addCell(docs11); document.add(docsTable); float[] colsWidthOther = { .4f, .4f, 4f }; PdfPTable otherDocTable = new PdfPTable(colsWidthOther); otherDocTable.setWidthPercentage(100); PdfPCell otherDoc1 = new PdfPCell(new Phrase(otherCheck, font3)); otherDoc1.setHorizontalAlignment(Element.ALIGN_CENTER); otherDoc1.setBorderWidth(0); otherDoc1.setBorderWidthBottom(1); otherDocTable.addCell(otherDoc1); PdfPCell otherDoc2 = new PdfPCell(new Phrase("Other", font3)); otherDoc2.setBorderWidth(0); otherDocTable.addCell(otherDoc2); PdfPCell otherDoc3 = new PdfPCell(new Phrase("", font3)); otherDoc3.setBorderWidth(0); otherDocTable.addCell(otherDoc3); otherDocTable.setSpacingAfter(8); document.add(otherDocTable); if (!otherComments.equals("")) { float[] colsWidthOtherComments = { 1.1f, 5f }; PdfPTable otherCommentsTable = new PdfPTable(colsWidthOtherComments); otherCommentsTable.setWidthPercentage(100); PdfPCell otherCommentLabel = new PdfPCell(new Phrase("Other Comments:", font3)); otherCommentLabel.setBorderWidth(0); otherCommentsTable.addCell(otherCommentLabel); PdfPCell otherCommentsInput = new PdfPCell(new Phrase(otherComments, font3)); otherCommentsInput.setBorderWidth(0); otherCommentsTable.addCell(otherCommentsInput); otherCommentsTable.setSpacingAfter(8); document.add(otherCommentsTable); } PdfPTable remarksTable = new PdfPTable(colsWidthRemarks); remarksTable.setWidthPercentage(100); PdfPCell remarkLabel = new PdfPCell(new Phrase("Remarks:", font3)); remarkLabel.setBorderWidth(0); remarksTable.addCell(remarkLabel); PdfPCell remarksInput = new PdfPCell(new Phrase(remarks, font3)); remarksInput.setBorderWidth(0); remarksTable.addCell(remarksInput); remarksTable.setSpacingAfter(8); document.add(remarksTable); Paragraph expediteOne = new Paragraph("-- PLEASE EXPEDITE --", font3); expediteOne.setSpacingBefore(5); expediteOne.setSpacingAfter(10); document.add(expediteOne); Paragraph disclosure = new Paragraph( "This fax is intended only for the use of the person or office to which it is addressed and may contain information that is privileged, confidential, or protected by law. All others are hereby notified that the receipt of this fax does not waive any applicable privilege or exemption for disclosure and that any dissemination, distribution, or copying of this communication is prohibited. If you have received this fax in error, please notify this office immediately at the telephone number listed above.", font2); disclosure.setAlignment(Element.ALIGN_JUSTIFIED); disclosure.setSpacingBefore(5); disclosure.setSpacingAfter(10); document.add(disclosure); float[] colsWidthPages = { 5f, .5f, 2f }; PdfPTable pagesTable = new PdfPTable(colsWidthPages); pagesTable.setWidthPercentage(71); PdfPCell pageOneLabel = new PdfPCell( new Phrase("This fax sheet consists of the cover page and ", fontHeader)); pageOneLabel.setBorderWidth(0); pageOneLabel.setHorizontalAlignment(Element.ALIGN_RIGHT); pagesTable.addCell(pageOneLabel); PdfPCell pages = new PdfPCell(new Phrase(faxPages, fontHeader)); pages.setBorderWidth(0); pages.setHorizontalAlignment(Element.ALIGN_CENTER); pages.setBorderWidthBottom(1); pagesTable.addCell(pages); PdfPCell pageTwoLabel = new PdfPCell(new Phrase(" additional pages", fontHeader)); pageTwoLabel.setBorderWidth(0); pagesTable.addCell(pageTwoLabel); pagesTable.setSpacingAfter(8); document.add(pagesTable); Paragraph expediteTwo = new Paragraph("FAX: 816-268-8163 ***** BURIAL PLEASE EXPEDITE *****", fontBold); expediteTwo.setSpacingBefore(5); expediteTwo.setSpacingAfter(10); document.add(expediteTwo); document.close(); } catch (Exception ex) { System.err.println(ex.getMessage()); } return new ByteArrayInputStream(outputStream.toByteArray()); }
From source file:IPDGES.ConcentForm.java
/** * Handles the HTTP <code>GET</code> method. * * @param request servlet request// ww w . ja va2 s . c om * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("application/pdf"); try { //style Font typeBold = new Font(Font.FontFamily.TIMES_ROMAN, 12, 1); Font type = new Font(Font.FontFamily.TIMES_ROMAN, 10); Font title = new Font(Font.FontFamily.TIMES_ROMAN, 15, 1); Font subTitle = new Font(Font.FontFamily.TIMES_ROMAN, 13, 1); Font subTitle2 = new Font(Font.FontFamily.TIMES_ROMAN, 10, 1); float space = (float) 20; Document document = new Document(); document.setPageSize(PageSize.LETTER); PdfWriter.getInstance(document, response.getOutputStream()); document.open(); //General PdfPTable table; Paragraph p1; Paragraph p2; PdfPCell cellRow1; PdfPCell cellRow2; //row: 1 table = new PdfPTable(2); table.setWidthPercentage(100); p1 = new Paragraph(space, "FORMULARIO DE CONSTANCIA DE INFORMACION AL PACIENTE GES", title); p1.setAlignment(Element.ALIGN_CENTER); cellRow1 = new PdfPCell(p1); cellRow1.setColspan(2); formatCellBorder(cellRow1, 20); table.addCell(cellRow1); p1 = new Paragraph(space, "(Artculo 24, Ley 19.966)", subTitle2); p1.setAlignment(Element.ALIGN_CENTER); cellRow1 = new PdfPCell(p1); cellRow1.setColspan(2); formatCellBorder(cellRow1, 20); table.addCell(cellRow1); document.add(table); document.add(new Paragraph("\n")); //row: 2 table = new PdfPTable(2); table.setWidthPercentage(100); p1 = new Paragraph(space, "DATOS DEL PRESTADOR", subTitle); cellRow1 = new PdfPCell(p1); cellRow1.setColspan(2); formatCellBorder(cellRow1, 20); cellRow1.setBorderWidthTop(1); cellRow1.setBorderWidthLeft(1); cellRow1.setBorderWidthRight(1); cellRow1.setBorderWidthBottom(1); table.addCell(cellRow1); p1 = new Paragraph(space, "INSTITUCIN (Hospital, Clnica, Consultorio,etc): " + institution, type); cellRow1 = new PdfPCell(p1); cellRow1.setColspan(2); formatCellBorder(cellRow1, 20); cellRow1.setBorderWidthLeft(1); cellRow1.setBorderWidthRight(1); table.addCell(cellRow1); p1 = new Paragraph(space, "DIRECCION: " + address, type); p2 = new Paragraph(space, "CIUDAD: " + city, type); cellRow1 = new PdfPCell(p1); cellRow2 = new PdfPCell(p2); formatCellBorder(cellRow1, 20); formatCellBorder(cellRow2, 20); cellRow1.setBorderWidthLeft(1); cellRow2.setBorderWidthRight(1); table.addCell(cellRow1); table.addCell(cellRow2); p1 = new Paragraph(space, "NOMBRE PERSONA QUE NOTIFICA: " + personName, type); p2 = new Paragraph(space, "RUT: " + rut, type); cellRow1 = new PdfPCell(p1); cellRow2 = new PdfPCell(p2); formatCellBorder(cellRow1, 20); formatCellBorder(cellRow2, 20); cellRow1.setBorderWidthLeft(1); cellRow2.setBorderWidthRight(1); cellRow1.setBorderWidthBottom(1); cellRow2.setBorderWidthBottom(1); table.addCell(cellRow1); table.addCell(cellRow2); document.add(table); document.add(new Paragraph("\n")); //row 3 table = new PdfPTable(2); table.setWidthPercentage(100); p1 = new Paragraph(space, "ANTECEDENTES DEL PACIENTE", subTitle); cellRow1 = new PdfPCell(p1); cellRow1.setColspan(2); formatCellBorder(cellRow1, 20); cellRow1.setBorderWidthTop(1); cellRow1.setBorderWidthLeft(1); cellRow1.setBorderWidthRight(1); cellRow1.setBorderWidthBottom(1); table.addCell(cellRow1); p1 = new Paragraph(space, "NOMBRE: " + patientName, type); cellRow1 = new PdfPCell(p1); cellRow1.setColspan(2); formatCellBorder(cellRow1, 20); cellRow1.setBorderWidthLeft(1); cellRow1.setBorderWidthRight(1); table.addCell(cellRow1); p1 = new Paragraph(space, "RUT: " + patientRut, type); p2 = new Paragraph(space, "FONASA: " + patientFonasa, type); cellRow1 = new PdfPCell(p1); cellRow2 = new PdfPCell(p2); formatCellBorder(cellRow1, 20); formatCellBorder(cellRow2, 20); cellRow1.setBorderWidthLeft(1); cellRow2.setBorderWidthRight(1); table.addCell(cellRow1); table.addCell(cellRow2); p1 = new Paragraph(space, "ISAPRE: " + patientIsapre, type); p2 = new Paragraph(space, "DOMICILIO: " + home, type); cellRow1 = new PdfPCell(p1); cellRow2 = new PdfPCell(p2); formatCellBorder(cellRow1, 20); formatCellBorder(cellRow2, 20); cellRow1.setBorderWidthLeft(1); cellRow2.setBorderWidthRight(1); table.addCell(cellRow1); table.addCell(cellRow2); p1 = new Paragraph(space, "COMUNA: " + commune, type); p2 = new Paragraph(space, "REGION: " + region, type); cellRow1 = new PdfPCell(p1); cellRow2 = new PdfPCell(p2); formatCellBorder(cellRow1, 20); formatCellBorder(cellRow2, 20); cellRow1.setBorderWidthLeft(1); cellRow2.setBorderWidthRight(1); table.addCell(cellRow1); table.addCell(cellRow2); p1 = new Paragraph(space, "N TELFONO FIJO: " + phoneNumber, type); p2 = new Paragraph(space, "N TELFONO CELULAR: " + celularNumber, type); cellRow1 = new PdfPCell(p1); cellRow2 = new PdfPCell(p2); formatCellBorder(cellRow1, 20); formatCellBorder(cellRow2, 20); cellRow1.setBorderWidthLeft(1); cellRow2.setBorderWidthRight(1); table.addCell(cellRow1); table.addCell(cellRow2); p1 = new Paragraph(space, "DIRECCIN CORREO ELECTRNICO (E-MAIL): " + mail, type); cellRow1 = new PdfPCell(p1); cellRow1.setColspan(2); formatCellBorder(cellRow1, 20); cellRow1.setBorderWidthLeft(1); cellRow1.setBorderWidthRight(1); cellRow1.setBorderWidthBottom(1); table.addCell(cellRow1); document.add(table); document.add(new Paragraph("\n")); //row 4 table = new PdfPTable(2); table.setWidthPercentage(100); p1 = new Paragraph(space, "INFORMACIN MDICA", subTitle); cellRow1 = new PdfPCell(p1); cellRow1.setColspan(2); formatCellBorder(cellRow1, 20); cellRow1.setBorderWidthTop(1); cellRow1.setBorderWidthLeft(1); cellRow1.setBorderWidthRight(1); cellRow1.setBorderWidthBottom(1); table.addCell(cellRow1); p1 = new Paragraph(space, "CONFIRMACIN DIAGNSTICA GES:", type); cellRow1 = new PdfPCell(p1); cellRow1.setColspan(2); formatCellBorder(cellRow1, 20); cellRow1.setBorderWidthLeft(1); cellRow1.setBorderWidthRight(1); table.addCell(cellRow1); p1 = new Paragraph(space, ges, type); cellRow1 = new PdfPCell(p1); cellRow1.setColspan(2); formatCellBorder(cellRow1, 20); cellRow1.setBorderWidthLeft(1); cellRow1.setBorderWidthRight(1); table.addCell(cellRow1); p1 = new Paragraph(space, "( ) Confirmacin Diagnstica", type); p2 = new Paragraph(space, "( ) Paciente en Tratamiento", type); cellRow1 = new PdfPCell(p1); cellRow2 = new PdfPCell(p2); formatCellBorder(cellRow1, 20); formatCellBorder(cellRow2, 20); cellRow1.setBorderWidthLeft(1); cellRow2.setBorderWidthRight(1); cellRow1.setBorderWidthBottom(1); cellRow2.setBorderWidthBottom(1); table.addCell(cellRow1); table.addCell(cellRow2); document.add(table); //row 5 document.add(new Paragraph(space, "CONSTANCIA", subTitle)); Paragraph text1 = new Paragraph(space, "Declaro que, con esta fecha y hora, he tomado conocimiento que tengo derecho a acceder a las Garantas Explcitas en Salud, siempre que la atencin sea otorgada en la red de Prestadores que me corresponde segn Fonasa o Isapre, a la que me encuentro adscrito", type); text1.setAlignment(Element.ALIGN_JUSTIFIED); document.add(text1); document.add(new Paragraph(space, "IMPORTANTE", subTitle)); Paragraph text2 = new Paragraph(space, "Tenga presente que s no se cumplen las garantas usted puede reclamar ante Fonasa o la Isapre, segn corresponda. Si la respuesta no es satisfactoria, usted puede recurrir en segunda instancia a la Superintendencia de Salud.", type); text2.setAlignment(Element.ALIGN_JUSTIFIED); document.add(text2); document.add(new Paragraph(space, "FECHA Y HORA DE NOTIFICACIN: " + "-", subTitle)); document.add(new Paragraph(space, "\n", type)); document.add(new Paragraph(space, "\n", type)); document.add(new Paragraph(space, "\n", type)); //row 6 table = new PdfPTable(2); table.setWidthPercentage(100); p1 = new Paragraph(space, "INFORM DIAGNSTICO GES", subTitle); p2 = new Paragraph(space, "TOM CONOCIMIENTO", subTitle); cellRow1 = new PdfPCell(p1); cellRow2 = new PdfPCell(p2); formatCellBorder(cellRow1, 20); formatCellBorder(cellRow2, 20); table.addCell(cellRow1); table.addCell(cellRow2); p1 = new Paragraph(space, "(Firma de persona que notifica)", subTitle2); p2 = new Paragraph(space, "(Firma o huella digital representante)", subTitle2); cellRow1 = new PdfPCell(p1); cellRow2 = new PdfPCell(p2); formatCellBorder(cellRow1, 20); formatCellBorder(cellRow2, 20); table.addCell(cellRow1); table.addCell(cellRow2); document.add(table); //row 7 document.add(new Paragraph(space, "En caso que la persona que tom conocimiento no sea el paciente, identificar.", type)); //row 8 table = new PdfPTable(2); table.setWidthPercentage(100); p1 = new Paragraph(space, "Nombre:", type); p2 = new Paragraph(space, "R.U.T:", type); cellRow1 = new PdfPCell(p1); cellRow2 = new PdfPCell(p2); formatCellBorder(cellRow1, 20); formatCellBorder(cellRow2, 20); table.addCell(cellRow1); table.addCell(cellRow2); p1 = new Paragraph(space, "N Telfono Celular:", type); p2 = new Paragraph(space, "Direccin correo electrnico (e-mail):", type); cellRow1 = new PdfPCell(p1); cellRow2 = new PdfPCell(p2); formatCellBorder(cellRow1, 20); formatCellBorder(cellRow2, 20); table.addCell(cellRow1); table.addCell(cellRow2); document.add(table); document.close(); } catch (DocumentException de) { throw new IOException(de.getMessage()); } }
From source file:jdbreport.model.io.pdf.itext5.ITextWriter.java
License:Apache License
protected int toPdfHAlignment(int horizontalAlignment) { switch (horizontalAlignment) { case CellStyle.LEFT: return Element.ALIGN_LEFT; case CellStyle.RIGHT: return Element.ALIGN_RIGHT; case CellStyle.CENTER: return Element.ALIGN_CENTER; case CellStyle.JUSTIFY: return Element.ALIGN_JUSTIFIED; }/*from ww w. j a v a 2 s.c o m*/ return Element.ALIGN_LEFT; }
From source file:jfx_horario.jefatura.JefaturaController.java
private void crearListaClasesDiariasPDF(Document document, Font fuente) throws DocumentException { if (lstHorario.getItems().size() > 0) { Paragraph clasesHoy = new Paragraph("Clases de hoy:", fuente); document.add(clasesHoy);/*from w w w . j a v a 2 s .c o m*/ document.add(new Paragraph(" ")); List list = new List(List.UNORDERED); for (int i = 0; i < lstHorario.getItems().size(); i++) { ListItem item = new ListItem((String) lstHorario.getItems().get(i)); item.setAlignment(Element.ALIGN_JUSTIFIED); list.add(item); } document.add(list); } }
From source file:managedbeanTest.PruebaMartolo.java
@Override public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("application/pdf"); try {//w w w . ja v a 2 s.c o m //style Font typeBold = new Font(Font.FontFamily.TIMES_ROMAN, 12, 1); Font type = new Font(Font.FontFamily.TIMES_ROMAN, 10); Font title = new Font(Font.FontFamily.TIMES_ROMAN, 15, 1); Font subTitle = new Font(Font.FontFamily.TIMES_ROMAN, 13, 1); Font subTitle2 = new Font(Font.FontFamily.TIMES_ROMAN, 10, 1); float space = (float) 20; Document document = new Document(); document.setPageSize(PageSize.LETTER); PdfWriter.getInstance(document, response.getOutputStream()); document.open(); //General PdfPTable table; Paragraph p1; Paragraph p2; PdfPCell cellRow1; PdfPCell cellRow2; //row: 1 table = new PdfPTable(2); table.setWidthPercentage(100); p1 = new Paragraph(space, "FORMULARIO DE CONSTANCIA DE INFORMACION AL PACIENTE GES", title); p1.setAlignment(Element.ALIGN_CENTER); cellRow1 = new PdfPCell(p1); cellRow1.setColspan(2); formatCellBorder(cellRow1, 20); table.addCell(cellRow1); p1 = new Paragraph(space, "(Artculo 24, Ley 19.966)", subTitle2); p1.setAlignment(Element.ALIGN_CENTER); cellRow1 = new PdfPCell(p1); cellRow1.setColspan(2); formatCellBorder(cellRow1, 20); table.addCell(cellRow1); document.add(table); document.add(new Paragraph("\n")); //row: 2 table = new PdfPTable(2); table.setWidthPercentage(100); p1 = new Paragraph(space, "DATOS DEL PRESTADOR", subTitle); cellRow1 = new PdfPCell(p1); cellRow1.setColspan(2); formatCellBorder(cellRow1, 20); cellRow1.setBorderWidthTop(1); cellRow1.setBorderWidthLeft(1); cellRow1.setBorderWidthRight(1); cellRow1.setBorderWidthBottom(1); table.addCell(cellRow1); p1 = new Paragraph(space, "INSTITUCIN (Hospital, Clnica, Consultorio,etc): " + institution, type); cellRow1 = new PdfPCell(p1); cellRow1.setColspan(2); formatCellBorder(cellRow1, 20); cellRow1.setBorderWidthLeft(1); cellRow1.setBorderWidthRight(1); table.addCell(cellRow1); p1 = new Paragraph(space, "DIRECCION: " + address, type); p2 = new Paragraph(space, "CIUDAD: " + city, type); cellRow1 = new PdfPCell(p1); cellRow2 = new PdfPCell(p2); formatCellBorder(cellRow1, 20); formatCellBorder(cellRow2, 20); cellRow1.setBorderWidthLeft(1); cellRow2.setBorderWidthRight(1); table.addCell(cellRow1); table.addCell(cellRow2); p1 = new Paragraph(space, "NOMBRE PERSONA QUE NOTIFICA: " + personName, type); p2 = new Paragraph(space, "RUT: " + rut, type); cellRow1 = new PdfPCell(p1); cellRow2 = new PdfPCell(p2); formatCellBorder(cellRow1, 20); formatCellBorder(cellRow2, 20); cellRow1.setBorderWidthLeft(1); cellRow2.setBorderWidthRight(1); cellRow1.setBorderWidthBottom(1); cellRow2.setBorderWidthBottom(1); table.addCell(cellRow1); table.addCell(cellRow2); document.add(table); document.add(new Paragraph("\n")); //row 3 table = new PdfPTable(2); table.setWidthPercentage(100); p1 = new Paragraph(space, "ANTECEDENTES DEL PACIENTE", subTitle); cellRow1 = new PdfPCell(p1); cellRow1.setColspan(2); formatCellBorder(cellRow1, 20); cellRow1.setBorderWidthTop(1); cellRow1.setBorderWidthLeft(1); cellRow1.setBorderWidthRight(1); cellRow1.setBorderWidthBottom(1); table.addCell(cellRow1); p1 = new Paragraph(space, "NOMBRE: " + patientName, type); cellRow1 = new PdfPCell(p1); cellRow1.setColspan(2); formatCellBorder(cellRow1, 20); cellRow1.setBorderWidthLeft(1); cellRow1.setBorderWidthRight(1); table.addCell(cellRow1); p1 = new Paragraph(space, "RUT: " + patientRut, type); p2 = new Paragraph(space, "FONASA: " + patientFonasa, type); cellRow1 = new PdfPCell(p1); cellRow2 = new PdfPCell(p2); formatCellBorder(cellRow1, 20); formatCellBorder(cellRow2, 20); cellRow1.setBorderWidthLeft(1); cellRow2.setBorderWidthRight(1); table.addCell(cellRow1); table.addCell(cellRow2); p1 = new Paragraph(space, "ISAPRE: " + patientIsapre, type); p2 = new Paragraph(space, "DOMICILIO: " + home, type); cellRow1 = new PdfPCell(p1); cellRow2 = new PdfPCell(p2); formatCellBorder(cellRow1, 20); formatCellBorder(cellRow2, 20); cellRow1.setBorderWidthLeft(1); cellRow2.setBorderWidthRight(1); table.addCell(cellRow1); table.addCell(cellRow2); p1 = new Paragraph(space, "COMUNA: " + commune, type); p2 = new Paragraph(space, "REGION: " + region, type); cellRow1 = new PdfPCell(p1); cellRow2 = new PdfPCell(p2); formatCellBorder(cellRow1, 20); formatCellBorder(cellRow2, 20); cellRow1.setBorderWidthLeft(1); cellRow2.setBorderWidthRight(1); table.addCell(cellRow1); table.addCell(cellRow2); p1 = new Paragraph(space, "N TELFONO FIJO: " + phoneNumber, type); p2 = new Paragraph(space, "N TELFONO CELULAR: " + celularNumber, type); cellRow1 = new PdfPCell(p1); cellRow2 = new PdfPCell(p2); formatCellBorder(cellRow1, 20); formatCellBorder(cellRow2, 20); cellRow1.setBorderWidthLeft(1); cellRow2.setBorderWidthRight(1); table.addCell(cellRow1); table.addCell(cellRow2); p1 = new Paragraph(space, "DIRECCIN CORREO ELECTRNICO (E-MAIL): " + mail, type); cellRow1 = new PdfPCell(p1); cellRow1.setColspan(2); formatCellBorder(cellRow1, 20); cellRow1.setBorderWidthLeft(1); cellRow1.setBorderWidthRight(1); cellRow1.setBorderWidthBottom(1); table.addCell(cellRow1); document.add(table); document.add(new Paragraph("\n")); //row 4 table = new PdfPTable(2); table.setWidthPercentage(100); p1 = new Paragraph(space, "INFORMACIN MDICA", subTitle); cellRow1 = new PdfPCell(p1); cellRow1.setColspan(2); formatCellBorder(cellRow1, 20); cellRow1.setBorderWidthTop(1); cellRow1.setBorderWidthLeft(1); cellRow1.setBorderWidthRight(1); cellRow1.setBorderWidthBottom(1); table.addCell(cellRow1); p1 = new Paragraph(space, "CONFIRMACIN DIAGNSTICA GES:", type); cellRow1 = new PdfPCell(p1); cellRow1.setColspan(2); formatCellBorder(cellRow1, 20); cellRow1.setBorderWidthLeft(1); cellRow1.setBorderWidthRight(1); table.addCell(cellRow1); p1 = new Paragraph(space, ges, type); cellRow1 = new PdfPCell(p1); cellRow1.setColspan(2); formatCellBorder(cellRow1, 20); cellRow1.setBorderWidthLeft(1); cellRow1.setBorderWidthRight(1); table.addCell(cellRow1); p1 = new Paragraph(space, "( ) Confirmacin Diagnstica", type); p2 = new Paragraph(space, "( ) Paciente en Tratamiento", type); cellRow1 = new PdfPCell(p1); cellRow2 = new PdfPCell(p2); formatCellBorder(cellRow1, 20); formatCellBorder(cellRow2, 20); cellRow1.setBorderWidthLeft(1); cellRow2.setBorderWidthRight(1); cellRow1.setBorderWidthBottom(1); cellRow2.setBorderWidthBottom(1); table.addCell(cellRow1); table.addCell(cellRow2); document.add(table); //row 5 document.add(new Paragraph(space, "CONSTANCIA", subTitle)); Paragraph text1 = new Paragraph(space, "Declaro que, con esta fecha y hora, he tomado conocimiento que tengo derecho a acceder a las Garantas Explcitas en Salud, siempre que la atencin sea otorgada en la red de Prestadores que me corresponde segn Fonasa o Isapre, a la que me encuentro adscrito", type); text1.setAlignment(Element.ALIGN_JUSTIFIED); document.add(text1); document.add(new Paragraph(space, "IMPORTANTE", subTitle)); Paragraph text2 = new Paragraph(space, "Tenga presente que s no se cumplen las garantas usted puede reclamar ante Fonasa o la Isapre, segn corresponda. Si la respuesta no es satisfactoria, usted puede recurrir en segunda instancia a la Superintendencia de Salud.", type); text2.setAlignment(Element.ALIGN_JUSTIFIED); document.add(text2); document.add(new Paragraph(space, "FECHA Y HORA DE NOTIFICACIN: " + "-", subTitle)); document.add(new Paragraph(space, "\n", type)); document.add(new Paragraph(space, "\n", type)); document.add(new Paragraph(space, "\n", type)); //row 6 table = new PdfPTable(2); table.setWidthPercentage(100); p1 = new Paragraph(space, "INFORM DIAGNSTICO GES", subTitle); p2 = new Paragraph(space, "TOM CONOCIMIENTO", subTitle); cellRow1 = new PdfPCell(p1); cellRow2 = new PdfPCell(p2); formatCellBorder(cellRow1, 20); formatCellBorder(cellRow2, 20); table.addCell(cellRow1); table.addCell(cellRow2); p1 = new Paragraph(space, "(Firma de persona que notifica)", subTitle2); p2 = new Paragraph(space, "(Firma o huella digital representante)", subTitle2); cellRow1 = new PdfPCell(p1); cellRow2 = new PdfPCell(p2); formatCellBorder(cellRow1, 20); formatCellBorder(cellRow2, 20); table.addCell(cellRow1); table.addCell(cellRow2); document.add(table); //row 7 document.add(new Paragraph(space, "En caso que la persona que tom conocimiento no sea el paciente, identificar.", type)); //row 8 table = new PdfPTable(2); table.setWidthPercentage(100); p1 = new Paragraph(space, "Nombre:", type); p2 = new Paragraph(space, "R.U.T:", type); cellRow1 = new PdfPCell(p1); cellRow2 = new PdfPCell(p2); formatCellBorder(cellRow1, 20); formatCellBorder(cellRow2, 20); table.addCell(cellRow1); table.addCell(cellRow2); p1 = new Paragraph(space, "N Telfono Celular:", type); p2 = new Paragraph(space, "Direccin correo electrnico (e-mail):", type); cellRow1 = new PdfPCell(p1); cellRow2 = new PdfPCell(p2); formatCellBorder(cellRow1, 20); formatCellBorder(cellRow2, 20); table.addCell(cellRow1); table.addCell(cellRow2); document.add(table); document.close(); } catch (DocumentException de) { throw new IOException(de.getMessage()); } }
From source file:nz.ac.waikato.cms.doc.SimplePDFOverlay.java
License:Open Source License
/** * Parses the alignment string.// w w w . java 2 s. c om * * @param str the alignment string * @return the alignment, see {@link Element} */ protected int parseAlignment(String str) { switch (str) { case "UNDEFINED": return Element.ALIGN_UNDEFINED; case "LEFT": return Element.ALIGN_LEFT; case "CENTER": return Element.ALIGN_CENTER; case "RIGHT": return Element.ALIGN_RIGHT; case "JUSTIFIED": return Element.ALIGN_JUSTIFIED; default: m_Logger.warning("Unhandled alignment, falling back to LEFT: " + str); return Element.ALIGN_LEFT; } }
From source file:org.bonitasoft.studio.migration.utils.PDFMigrationReportWriter.java
License:Open Source License
private void addTableRow(PdfPTable table, Change change) throws BadElementException, MalformedURLException, IOException { PdfPCell cell = new PdfPCell(new Phrase(change.getElementType())); cell.setHorizontalAlignment(Element.ALIGN_LEFT); cell.setVerticalAlignment(Element.ALIGN_CENTER); table.addCell(cell);// www . j a v a2 s. c o m cell = new PdfPCell(new Phrase(change.getElementName())); cell.setHorizontalAlignment(Element.ALIGN_LEFT); cell.setVerticalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase(change.getPropertyName())); cell.setHorizontalAlignment(Element.ALIGN_LEFT); cell.setVerticalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase(change.getDescription())); cell.setHorizontalAlignment(Element.ALIGN_JUSTIFIED); cell.setVerticalAlignment(Element.ALIGN_TOP); cell.setPadding(4f); table.addCell(cell); cell = new PdfPCell(getImageForStatus(change.getStatus()), false); cell.setPadding(10f); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setVerticalAlignment(Element.ALIGN_CENTER); table.addCell(cell); String reviewed = Messages.no; if (change.isReviewed()) { reviewed = Messages.yes; } cell = new PdfPCell(new Phrase(reviewed)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setVerticalAlignment(Element.ALIGN_CENTER); table.addCell(cell); }
From source file:org.fossa.rolp.util.PdfStreamSource.java
License:Open Source License
private void addFacheinschaetzungen(Chapter chapterLEB, PdfWriter writer) throws DocumentException, PdfFormatierungsException { for (LebFacheinschaetzungData facheinschaetzungsdaten : lebData.getFacheinschaetzungsdaten()) { sectionCount += 1;//from ww w.ja v a 2 s . c om breakHurenkind(writer); breakSchusterjunge(writer); Paragraph paragraphFacheinschaetzung = new Paragraph(); Section facheinschaetzungsTextSection = chapterLEB.addSection(paragraphFacheinschaetzung); facheinschaetzungsTextSection.setNumberDepth(0); Collection<String> fachbezeichnungen = facheinschaetzungsdaten.getFachbezeichnungen(); fachbezeichnungen.add(facheinschaetzungsdaten.getFachname()); String facheinschaetzung = facheinschaetzungsdaten.getFacheinschaetzung(); Integer firstIndex = null; String boldedWord = ""; for (String fachbezeichnung : fachbezeichnungen) { int index = facheinschaetzung.toLowerCase().indexOf(fachbezeichnung.toLowerCase()); if (index != -1 && (firstIndex == null || firstIndex > index)) { firstIndex = index; boldedWord = fachbezeichnung; } } Paragraph facheinschaetzungParapgraph = new Paragraph(); facheinschaetzungParapgraph.setAlignment(Element.ALIGN_JUSTIFIED); facheinschaetzungParapgraph.setLeading(FIXED_LEADING_TEXT, zeilenabstandsfaktor); if (firstIndex == null) { facheinschaetzungParapgraph.add(new Phrase( facheinschaetzungsdaten.getFacheinschaetzung().replace('\t', '\0'), standardTextFont)); } else { String beforeBoldWord = facheinschaetzung.substring(0, firstIndex); facheinschaetzungParapgraph.add(new Phrase(beforeBoldWord.replace('\t', '\0'), standardTextFont)); String boldWord = facheinschaetzung.substring(firstIndex, firstIndex + boldedWord.length()); facheinschaetzungParapgraph.add(new Phrase(boldWord, standardTextBoldFont)); String afterBoldWord = facheinschaetzung.substring(firstIndex + boldedWord.length()); facheinschaetzungParapgraph.add(new Phrase(afterBoldWord.replace('\t', '\0'), standardTextFont)); } facheinschaetzungParapgraph.setFont(standardTextFont); facheinschaetzungsTextSection.add(facheinschaetzungParapgraph); Paragraph unterschriftParagraph = new Paragraph(); document.add(facheinschaetzungsTextSection); Section facheinschaetzungsUnterschriftSection = chapterLEB.addSection(unterschriftParagraph); facheinschaetzungsUnterschriftSection.setNumberDepth(0); unterschriftParagraph.add( new Phrase(facheinschaetzungsdaten.getUnterschrift().replace('\t', '\0'), standardTextFont)); unterschriftParagraph.setAlignment(Element.ALIGN_RIGHT); unterschriftParagraph.add(Chunk.NEWLINE); unterschriftParagraph.add(Chunk.NEWLINE); document.add(facheinschaetzungsUnterschriftSection); alertHurenkind(writer); insertDummyLineIfNecessary(writer); } }
From source file:org.fossa.rolp.util.PdfStreamSource.java
License:Open Source License
private void addIndividuelleEinschaetzung(Chapter chapterLEB, PdfWriter writer) throws DocumentException, PdfFormatierungsException { if (!lebData.getIndividuelleEinschaetzung().isEmpty()) { sectionCount += 1;/*from w w w. j a v a2 s . c o m*/ breakHurenkind(writer); breakSchusterjunge(writer); Paragraph paragraphIndividuelleEinschaetzung = new Paragraph(); Section individuelleEinschaetzungsTextSection = chapterLEB .addSection(paragraphIndividuelleEinschaetzung); individuelleEinschaetzungsTextSection.setNumberDepth(0); Paragraph schuelereinschaetzungParapgraph = new Paragraph( lebData.getIndividuelleEinschaetzung().replace('\t', '\0'), standardTextFont); schuelereinschaetzungParapgraph.setAlignment(Element.ALIGN_JUSTIFIED); schuelereinschaetzungParapgraph.setLeading(FIXED_LEADING_TEXT, zeilenabstandsfaktor); individuelleEinschaetzungsTextSection.add(schuelereinschaetzungParapgraph); document.add(individuelleEinschaetzungsTextSection); document.add(getKlassenlehrerunterschrift(chapterLEB)); alertHurenkind(writer); insertDummyLineIfNecessary(writer); } }