Examples of PdfPCell


Examples of com.lowagie.text.pdf.PdfPCell

  }
 
  private PdfPTable addDeductionTable() throws DocumentException {
    //Title
    PdfPCell[] groupTitleCell = new PdfPCell[1];
    groupTitleCell[0] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.process.accomptes.retenuesEffectuees",null,localtion),contentBoldFont))
    float[] wfTitle = {
        100
      };
    for (PdfPCell pdfPCell : groupTitleCell) {
      pdfPCell.setBorder(Rectangle.NO_BORDER);
      pdfPCell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT);
    }

    PdfPTable titleTable = new PdfPTable(1);
    titleTable.setWidthPercentage(100f);
    titleTable.setWidths(wfTitle);
    addCellsToTable(titleTable,groupTitleCell);
    addContent(titleTable);
   
    //Add Group Header
    PdfPCell[] groupHeaderCell = new PdfPCell[3];
    groupHeaderCell[0] = new PdfPCell();
    groupHeaderCell[0].setBorder(Rectangle.NO_BORDER);
   
    groupHeaderCell[1] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.process.accomptes.quante", null,localtion), contentBoldFont));
    groupHeaderCell[1].setBackgroundColor(new Color(Constants.RED,Constants.GREEN,Constants.BLUE));

    groupHeaderCell[2] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.process.accomptes.montant", null, localtion), contentBoldFont));
    groupHeaderCell[2].setBackgroundColor(new Color(Constants.RED,Constants.GREEN,Constants.BLUE));
   
    float[] wfGroupHeader = {
        10,
        70,
        20
      };
    for (PdfPCell pdfPCell : groupHeaderCell) {
      pdfPCell.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
    }

    PdfPTable groupHeaderTable = new PdfPTable(3);
    groupHeaderTable.setWidthPercentage(100f);
    groupHeaderTable.setWidths(wfGroupHeader);
    addCellsToTable(groupHeaderTable,groupHeaderCell);
    addContent(groupHeaderTable);
   
    //create table header
    PdfPCell[] deductionTableHeader = new PdfPCell[10];
   
    String[] arrPrestations = prestation.split(Constants.SEPRATE);
   
    deductionTableHeader[0] = new PdfPCell(new Phrase(messageSource.getMessage("FicheST.date",null,localtion), contentBoldFont));
    deductionTableHeader[1] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.process.accomptes.canto",null,localtion) + arrPrestations[0], contentBoldFont));
    deductionTableHeader[2] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.process.accomptes.badge",null,localtion) + arrPrestations[1], contentBoldFont));
    deductionTableHeader[3] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.process.accomptes.grue",null,localtion) + arrPrestations[2], contentBoldFont))
    deductionTableHeader[4] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.process.accomptes.lift",null,localtion) + arrPrestations[3], contentBoldFont));   
    deductionTableHeader[5] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.process.accomptes.bene",null,localtion) + arrPrestations[4], contentBoldFont))
    deductionTableHeader[6] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.process.accomptes.nettoyage",null,localtion) + arrPrestations[5], contentBoldFont));
    deductionTableHeader[7] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.process.accomptes.autres",null,localtion), contentBoldFont));
    deductionTableHeader[8] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.process.accomptes.prorata",null,localtion) + arrPrestations[6], contentBoldFont));
    deductionTableHeader[9] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.process.accomptes.refacturations",null,localtion), contentBoldFont));
   
    for (PdfPCell pdfPCell : deductionTableHeader) {
      pdfPCell.setBackgroundColor(new Color(Constants.RED,Constants.GREEN,Constants.BLUE));
      pdfPCell.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
    }
    PdfPTable deductionTable = new PdfPTable(10);
   
    //Add Header
    addCellsToTable(deductionTable, deductionTableHeader);
   
    //Add Content
    String[] tmp = deductions.split(Constants.SEPRATE);
    for(int i=0;i<tmp.length;i++){
      deductionTable.addCell(new PdfPCell(new Phrase(tmp[i], contentNormalFont)));
    }
    float[] wf = {
        10,
        10,
        10,
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.