Examples of Phrase


Examples of com.lowagie.text.Phrase

    return ct;
  }

  private Phrase createPhrase(final RenderableComplexText node)
  {
    Phrase p = new Phrase();
    RichTextSpec text = node.getRichText();
    for (RichTextSpec.StyledChunk c : text.getStyleChunks())
    {
      TypedMapWrapper<Attribute, Object> attributes = new TypedMapWrapper<Attribute, Object>(c.getAttributes());
      final Number size = attributes.get(TextAttribute.SIZE, 10f, Number.class);
      final PdfTextSpec pdfTextSpec = computeFont(c);
      final int style = computeStyle(attributes, pdfTextSpec);

      final Color paint = (Color) c.getStyleSheet().getStyleProperty(ElementStyleKeys.PAINT);
      // add chunks
      BaseFont baseFont = pdfTextSpec.getFontMetrics().getBaseFont();
      Font font = new Font(baseFont, size.floatValue(), style, paint);

      if (c.getOriginatingTextNode() instanceof RenderableReplacedContentBox)
      {
        RenderableReplacedContentBox content = (RenderableReplacedContentBox) c.getOriginatingTextNode();
        com.lowagie.text.Image image = imageHandler.createImage(content);
        if (image != null)
        {
          Chunk chunk = new Chunk(image, 0, 0);
        //  chunk.setFont(font);
          p.add(chunk);
        }
      }
      else
      {
        String textToPrint = c.getText();
        Chunk chunk = new Chunk(textToPrint, font);
        p.add(chunk);
      }
    }
    return p;
  }
View Full Code Here

Examples of com.lowagie.text.Phrase

                                                        packageData );

            document.newPage();

            // List index of the rules           
            document.add( new Phrase( "Table of Contents" ) );
            document.add( DroolsDocsComponentFactory.createContents( packageData.getRules() ) );

            document.newPage();

            for ( DrlRuleParser ruleData : packageData.getRules() ) {
View Full Code Here

Examples of com.lowagie.text.Phrase

        return index;
    }

    private static Cell newHeaderCell(String text,
                                      Font font) throws BadElementException {
        Cell c = new Cell( new Phrase( text,
                                       font ) );
        c.setBackgroundColor( Color.decode( "#CCCCFF" ) );
        c.setLeading( 10 );
        c.setBorder( 1 );
View Full Code Here

Examples of com.lowagie.text.Phrase

        return c;
    }

    private static Cell newCell(String text) throws BadElementException {
        Cell c = new Cell( new Phrase( text,
                                       BODY_TEXT ) );
        c.setLeading( 10 );
        c.setBorder( 0 );
        c.setBorderWidthBottom( 1 );
View Full Code Here

Examples of com.lowagie.text.Phrase

        return c;
    }

    public static HeaderFooter createFooter(String packageName) {
        HeaderFooter footer = new HeaderFooter( new Phrase( packageName + "-",
                                                            HEADER_FOOTER_TEXT ),
                                                true );
        footer.setBorder( 1 );
        footer.setAlignment( Element.ALIGN_RIGHT );
View Full Code Here

Examples of com.lowagie.text.Phrase

            cell1.setHorizontalAlignment( Element.ALIGN_LEFT );
            cell1.setBorder( 0 );

            head.addCell( cell1 );

            PdfPCell cell2 = new PdfPCell( new Phrase( currentDate,
                                                       DroolsDocsComponentFactory.HEADER_FOOTER_TEXT ) );
            cell2.setHorizontalAlignment( Element.ALIGN_RIGHT );
            cell2.setBorder( 0 );

            head.addCell( cell2 );
View Full Code Here

Examples of com.lowagie.text.Phrase

     * @param doc
     *  document object
     */
    public void addHeaderFooter(Document doc) {
            // Set the author name and project description as the file header
            HeaderFooter footer = new HeaderFooter(new Phrase(projectDesc + " - " + author, FontFactory.getFont(FontFactory.TIMES_ROMAN, 10, Font.NORMAL, new Color(64, 62, 62))), false);

            // Set page number as the file footer
            HeaderFooter header = new HeaderFooter(new Phrase("Page ", FontFactory.getFont(FontFactory.TIMES_ROMAN, 10, Font.NORMAL, new Color(64, 62, 62))), true);
            footer.disableBorderSide(Rectangle.TOP);
            footer.disableBorderSide(Rectangle.BOTTOM);

            // Set the footer alignment to the center
            footer.setAlignment(Rectangle.ALIGN_CENTER);
View Full Code Here

Examples of com.lowagie.text.Phrase

            // Generates the data table
            int rowNo = 5;
            PdfPTable dataTableHeader = new PdfPTable(rowNo);
            PdfPCell dataTblHeaderCell;

            Phrase pTemp = new Phrase("NODE", FontFactory.getFont(FontFactory.TIMES_ROMAN, 8, Font.BOLD));
            dataTblHeaderCell = new PdfPCell(pTemp);
            dataTblHeaderCell.setHorizontalAlignment(Element.ALIGN_CENTER);
            dataTableHeader.addCell(dataTblHeaderCell);
            pTemp = new Phrase("DEPTH"+"\n"+"(m)", FontFactory.getFont(FontFactory.TIMES_ROMAN, 8, Font.BOLD));
            dataTblHeaderCell = new PdfPCell(pTemp);
            dataTblHeaderCell.setHorizontalAlignment(Element.ALIGN_CENTER);
            dataTableHeader.addCell(dataTblHeaderCell);
            pTemp = new Phrase("MODULUS OF SUBGRADE REACTION"+"\n"+"(kN/m)", FontFactory.getFont(FontFactory.TIMES_ROMAN, 8, Font.BOLD));
            dataTblHeaderCell = new PdfPCell(pTemp);
            dataTblHeaderCell.setHorizontalAlignment(Element.ALIGN_CENTER);
            dataTableHeader.addCell(dataTblHeaderCell);
            pTemp = new Phrase("LATERAL SOIL MOVEMENTS"+"\n"+"(m)", FontFactory.getFont(FontFactory.TIMES_ROMAN, 8, Font.BOLD));
            dataTblHeaderCell = new PdfPCell(pTemp);
            dataTblHeaderCell.setHorizontalAlignment(Element.ALIGN_CENTER);
            dataTableHeader.addCell(dataTblHeaderCell);
            pTemp = new Phrase("LIMIT SOIL PRESSURE"+"\n"+"(kN/m²)", FontFactory.getFont(FontFactory.TIMES_ROMAN, 8, Font.BOLD));
            dataTblHeaderCell = new PdfPCell(pTemp);
            dataTblHeaderCell.setHorizontalAlignment(Element.ALIGN_CENTER);
            dataTableHeader.addCell(dataTblHeaderCell);

            PdfPCell dataTblCell;
           
            PdfPTable dataTable = new PdfPTable(rowNo);
            for (int i = 0; i <= data.getNumOfElements(); i++) {

                Phrase pNode = new Phrase(Integer.toString(i), FontFactory.getFont(FontFactory.TIMES_ROMAN, 8, Font.BOLD));
                dataTblCell = new PdfPCell(pNode);
                dataTblCell.setHorizontalAlignment(Element.ALIGN_CENTER);
                dataTable.addCell(dataTblCell);
                Phrase pPileNodeCoord = new Phrase(Double.toString(data.getPileNodeCoordinate(i)), FontFactory.getFont(FontFactory.TIMES_ROMAN, 9, Font.NORMAL));
                dataTblCell = new PdfPCell(pPileNodeCoord);
                dataTblCell.setHorizontalAlignment(Element.ALIGN_CENTER);
                dataTable.addCell(dataTblCell);
                Phrase pModOfSub = new Phrase(Double.toString(data.getModOfSubgradeReaction(i)), FontFactory.getFont(FontFactory.TIMES_ROMAN, 9, Font.NORMAL));
                dataTblCell = new PdfPCell(pModOfSub);
                dataTblCell.setHorizontalAlignment(Element.ALIGN_CENTER);
                dataTable.addCell(dataTblCell);
                Phrase pLateralSoilMov = new Phrase(Double.toString(data.getLateralSoilMovement(i)), FontFactory.getFont(FontFactory.TIMES_ROMAN, 9, Font.NORMAL));
                dataTblCell = new PdfPCell(pLateralSoilMov);
                dataTblCell.setHorizontalAlignment(Element.ALIGN_CENTER);
                dataTable.addCell(dataTblCell);
                Phrase pLimitSoilPress = new Phrase(Double.toString(data.getLimitSoilPressure(i)), FontFactory.getFont(FontFactory.TIMES_ROMAN, 9, Font.NORMAL));
                dataTblCell = new PdfPCell(pLimitSoilPress);
                dataTblCell.setHorizontalAlignment(Element.ALIGN_CENTER);
                dataTable.addCell(dataTblCell);
              
            }
            doc.add(dataTableHeader);
            doc.add(dataTable);
            doc.newPage();

            // Create the title for the result table
            Chunk theResultTable = new Chunk("The Result Table", new Font(Font.TIMES_ROMAN, 18, Font.BOLD));
            Paragraph pResult = new Paragraph(theResultTable);
            pResult.setAlignment(Element.ALIGN_CENTER);
            doc.add(pResult);
            doc.add(Chunk.NEWLINE);

            // Generates the result table
            rowNo = 9;
            PdfPTable resultTableHeader = new PdfPTable(rowNo);
            PdfPCell resultTblHeaderCell;

            pTemp = new Phrase("NODE", FontFactory.getFont(FontFactory.TIMES_ROMAN, 8, Font.BOLD));
            resultTblHeaderCell = new PdfPCell(pTemp);
            resultTblHeaderCell.setHorizontalAlignment(Element.ALIGN_CENTER);
            resultTableHeader.addCell(resultTblHeaderCell);
            pTemp = new Phrase("DEPTH"+"\n"+"(m)", FontFactory.getFont(FontFactory.TIMES_ROMAN, 8, Font.BOLD));
            resultTblHeaderCell = new PdfPCell(pTemp);
            resultTblHeaderCell.setHorizontalAlignment(Element.ALIGN_CENTER);
            resultTableHeader.addCell(resultTblHeaderCell);
            pTemp = new Phrase("SOIL MOVEMENT"+"\n"+"(mm)", FontFactory.getFont(FontFactory.TIMES_ROMAN, 8, Font.BOLD));
            resultTblHeaderCell = new PdfPCell(pTemp);
            resultTblHeaderCell.setHorizontalAlignment(Element.ALIGN_CENTER);
            resultTableHeader.addCell(resultTblHeaderCell);
            pTemp = new Phrase("SOIL PRESSURE"+"\n"+"(kPa)", FontFactory.getFont(FontFactory.TIMES_ROMAN, 8, Font.BOLD));
            resultTblHeaderCell = new PdfPCell(pTemp);
            resultTblHeaderCell.setHorizontalAlignment(Element.ALIGN_CENTER);
            resultTableHeader.addCell(resultTblHeaderCell);
            pTemp = new Phrase("ABS"+"\n"+"SOIL PRESSURE"+"\n"+"(kPa)", FontFactory.getFont(FontFactory.TIMES_ROMAN, 8, Font.BOLD));
            resultTblHeaderCell = new PdfPCell(pTemp);
            resultTblHeaderCell.setHorizontalAlignment(Element.ALIGN_CENTER);
            resultTableHeader.addCell(resultTblHeaderCell);
            pTemp = new Phrase("DISPLACEMENT"+"\n"+"(mm)", FontFactory.getFont(FontFactory.TIMES_ROMAN, 8, Font.BOLD));
            resultTblHeaderCell = new PdfPCell(pTemp);
            resultTblHeaderCell.setHorizontalAlignment(Element.ALIGN_CENTER);
            resultTableHeader.addCell(resultTblHeaderCell);
            pTemp = new Phrase("ROTATION"+"\n"+"(rad)", FontFactory.getFont(FontFactory.TIMES_ROMAN, 7, Font.BOLD));
            resultTblHeaderCell = new PdfPCell(pTemp);
            resultTblHeaderCell.setHorizontalAlignment(Element.ALIGN_CENTER);
            resultTableHeader.addCell(resultTblHeaderCell);
            pTemp = new Phrase("BENDING MOMENT"+"\n"+"(kNm)", FontFactory.getFont(FontFactory.TIMES_ROMAN, 8, Font.BOLD));
            resultTblHeaderCell = new PdfPCell(pTemp);
            resultTblHeaderCell.setHorizontalAlignment(Element.ALIGN_CENTER);
            resultTableHeader.addCell(resultTblHeaderCell);
            pTemp = new Phrase("SHEAR FORCE"+"\n"+"(kN)", FontFactory.getFont(FontFactory.TIMES_ROMAN, 8, Font.BOLD));
            resultTblHeaderCell = new PdfPCell(pTemp);
            resultTblHeaderCell.setHorizontalAlignment(Element.ALIGN_CENTER);
            resultTableHeader.addCell(resultTblHeaderCell);

            PdfPTable resultTable = new PdfPTable(rowNo);
            PdfPCell resultTblCell;
           
            for (int i = 0; i < data.getNumOfElements() + 1; i++) {
               
                Phrase pNodes = new Phrase(Integer.toString(i), FontFactory.getFont(FontFactory.TIMES_ROMAN, 9, Font.BOLD));
                resultTblCell = new PdfPCell(pNodes);
                resultTblCell.setHorizontalAlignment(Element.ALIGN_CENTER);
                resultTable.addCell(resultTblCell);
                Phrase pPileNodeCoord = new Phrase(Double.toString(data.getPileNodeCoordinate(i)), FontFactory.getFont(FontFactory.TIMES_ROMAN, 9, Font.NORMAL));
                resultTblCell = new PdfPCell(pPileNodeCoord);
                resultTblCell.setHorizontalAlignment(Element.ALIGN_CENTER);
                resultTable.addCell(resultTblCell);
                Phrase pSoilMov = new Phrase(Double.toString(result.getSoilMovement(i)), FontFactory.getFont(FontFactory.TIMES_ROMAN, 9, Font.NORMAL));
                resultTblCell = new PdfPCell(pSoilMov);
                resultTblCell.setHorizontalAlignment(Element.ALIGN_CENTER);
                resultTable.addCell(resultTblCell);
                Phrase pSoilPress = new Phrase(Double.toString(result.getSoilPressure(i)), FontFactory.getFont(FontFactory.TIMES_ROMAN, 9, Font.NORMAL));
                resultTblCell = new PdfPCell(pSoilPress);
                resultTblCell.setHorizontalAlignment(Element.ALIGN_CENTER);
                resultTable.addCell(resultTblCell);
                Phrase pLimitPressure = new Phrase(Double.toString(result.getLimitPressure(i)), FontFactory.getFont(FontFactory.TIMES_ROMAN, 9, Font.NORMAL));
                resultTblCell = new PdfPCell(pLimitPressure);
                resultTblCell.setHorizontalAlignment(Element.ALIGN_CENTER);
                resultTable.addCell(resultTblCell);
                Phrase pDisplacement = new Phrase(Double.toString(result.getDisplacement(i)), FontFactory.getFont(FontFactory.TIMES_ROMAN, 9, Font.NORMAL));
                resultTblCell = new PdfPCell(pDisplacement);
                resultTblCell.setHorizontalAlignment(Element.ALIGN_CENTER);
                resultTable.addCell(resultTblCell);
                Phrase pRotation = new Phrase(Double.toString(result.getRotation(i)), FontFactory.getFont(FontFactory.TIMES_ROMAN, 9, Font.NORMAL));
                resultTblCell = new PdfPCell(pRotation);
                resultTblCell.setHorizontalAlignment(Element.ALIGN_CENTER);
                resultTable.addCell(resultTblCell);
                Phrase pBendingMoment = new Phrase(Double.toString(result.getBendingMoment(i)), FontFactory.getFont(FontFactory.TIMES_ROMAN, 9, Font.NORMAL));
                resultTblCell = new PdfPCell(pBendingMoment);
                resultTblCell.setHorizontalAlignment(Element.ALIGN_CENTER);
                resultTable.addCell(resultTblCell);
                Phrase pShearForce = new Phrase(Double.toString(result.getShearForce(i)), FontFactory.getFont(FontFactory.TIMES_ROMAN, 9, Font.NORMAL));
                resultTblCell = new PdfPCell(pShearForce);
                resultTblCell.setHorizontalAlignment(Element.ALIGN_CENTER);
                resultTable.addCell(resultTblCell);
               
            }
View Full Code Here

Examples of com.lowagie.text.Phrase

  protected void addGestionDto() throws DocumentException {
   
    PdfPTable headerTable = new PdfPTable(1);
    headerTable.setWidthPercentage(100f);
   
    PdfPCell headerCell = new PdfPCell(new Phrase(messageSource.getMessage("pdf.gestiondto.suividegestiondusoustraitant", null, localtion), contentBoldFont));
    headerCell.setBorder(Rectangle.NO_BORDER);
    headerCell.setHorizontalAlignment(PdfPTable.ALIGN_CENTER);
    headerTable.addCell(headerCell);
    addContent(headerTable);
    lineBreak();
   
    headerTable = new PdfPTable(1);
    headerTable.setWidthPercentage(100f);
    headerCell = new PdfPCell(new Phrase(messageSource.getMessage("FicheST.generalInformation", null, localtion), contentBoldFont));
    headerCell.setBorder(Rectangle.NO_BORDER);
    headerCell.setHorizontalAlignment(PdfPTable.ALIGN_LEFT);
    headerTable.addCell(headerCell);
    addContent(headerTable);
   
    String arrGeneraleInformation[]= generaleInformation.split(Constants.SEPRATE);
    PdfPTable generaleInformationTable = new PdfPTable(6);
    PdfPCell generaleInformationCell;
    generaleInformationTable.setWidthPercentage(100f);
    String [] messages = {messageSource.getMessage("FicheST.chantier",null, localtion) + " : ",messageSource.getMessage("FicheST.lot", null, localtion) + " : ",
        messageSource.getMessage("FicheST.foreman", null, localtion) + " : ",
        messageSource.getMessage("pdf.synthese.societe", null, localtion) + " : ",messageSource.getMessage("FicheST.lotType", null, localtion) + " : ",
        messageSource.getMessage("pdf.gestiondto.montantobjectif",null,localtion) + " : "};
    for(int i=0;i<arrGeneraleInformation.length;i++){
      switch (i) {
        case 0
          generaleInformationCell = new PdfPCell(new Phrase(messages[0], contentBoldFont));
          generaleInformationCell.setBorder(Rectangle.NO_BORDER);
          generaleInformationCell.enableBorderSide(Rectangle.TOP);
          generaleInformationCell.enableBorderSide(Rectangle.LEFT);
          generaleInformationTable.addCell(generaleInformationCell);
         
          break;
        case 1
          generaleInformationCell = new PdfPCell(new Phrase(messages[1], contentBoldFont));
          generaleInformationCell.setBorder(Rectangle.NO_BORDER);
          generaleInformationCell.enableBorderSide(Rectangle.TOP);
          generaleInformationTable.addCell(generaleInformationCell);
          break;
        case 2
          generaleInformationCell = new PdfPCell(new Phrase(messages[2], contentBoldFont));
          generaleInformationCell.setBorder(Rectangle.NO_BORDER);
          generaleInformationCell.enableBorderSide(Rectangle.TOP);
          generaleInformationTable.addCell(generaleInformationCell);
          break;
        case 3
          generaleInformationCell = new PdfPCell(new Phrase(messages[3], contentBoldFont));
          generaleInformationCell.setBorder(Rectangle.NO_BORDER);
          generaleInformationCell.enableBorderSide(Rectangle.BOTTOM);
          generaleInformationCell.enableBorderSide(Rectangle.LEFT);
          generaleInformationTable.addCell(generaleInformationCell);
          break;
        case 4
          generaleInformationCell = new PdfPCell(new Phrase(messages[4], contentBoldFont));
          generaleInformationCell.setBorder(Rectangle.NO_BORDER);
          generaleInformationCell.enableBorderSide(Rectangle.BOTTOM);
          generaleInformationTable.addCell(generaleInformationCell);
          break;
        case 5
          generaleInformationCell = new PdfPCell(new Phrase(messages[5], contentBoldFont));
          generaleInformationCell.setBorder(Rectangle.NO_BORDER);
          generaleInformationCell.enableBorderSide(Rectangle.BOTTOM);
          generaleInformationTable.addCell(generaleInformationCell);
          break;
      }
      generaleInformationCell = new PdfPCell(new Phrase(arrGeneraleInformation[i].equals("null") ? "" : arrGeneraleInformation[i], contentNormalFont));
      if(i == 0 || i == 1 || i == 2){
        generaleInformationCell.setBorder(Rectangle.NO_BORDER);
        generaleInformationCell.enableBorderSide(Rectangle.TOP);
        if(i == 2)
          generaleInformationCell.enableBorderSide(Rectangle.RIGHT);
        generaleInformationTable.addCell(generaleInformationCell);
      }
      if(i == 3 || i == 4 || i == 5){
        generaleInformationCell.setBorder(Rectangle.NO_BORDER);
        generaleInformationCell.enableBorderSide(Rectangle.BOTTOM);
        if(i == 5)
          generaleInformationCell.enableBorderSide(Rectangle.RIGHT);
        generaleInformationTable.addCell(generaleInformationCell);
      }
    }
    float[] wfGeneraleInformation = {
        3,
        6,
        3,
        6,
        7,
        6
      };
    generaleInformationTable.setWidths(wfGeneraleInformation);
    //Set space
    generaleInformationTable.setSpacingAfter(15f);
    addContent(generaleInformationTable);
   
    //Header
    headerTable = new PdfPTable(1);
    headerTable.setWidthPercentage(100f);
    headerCell = new PdfPCell(new Phrase(messageSource.getMessage("FicheST.gestion", null,localtion), contentBoldFont));
    headerCell.setBorder(Rectangle.NO_BORDER);
    headerTable.addCell(headerCell);
    addContent(headerTable);
 
    //Add Group Header
    PdfPCell[] groupHeaderCell = new PdfPCell[6];
    groupHeaderCell[0] = new PdfPCell();
    groupHeaderCell[0].setBorder(Rectangle.NO_BORDER);
    groupHeaderCell[1] = new PdfPCell(new Phrase("TRAITE", contentBoldFont));
    groupHeaderCell[1].setBackgroundColor(new Color(Constants.RED,Constants.GREEN,Constants.BLUE));

    groupHeaderCell[2] = new PdfPCell(new Phrase("A TRAITER", contentBoldFont));
    groupHeaderCell[2].setBackgroundColor(new Color(Constants.RED,Constants.GREEN,Constants.BLUE));
    groupHeaderCell[3] = new PdfPCell(new Phrase("BUDGET Conforme", contentBoldFont));
    groupHeaderCell[3].setBackgroundColor(new Color(Constants.RED,Constants.GREEN,Constants.BLUE));
   
    groupHeaderCell[4] = new PdfPCell();
    groupHeaderCell[4].setBorder(Rectangle.NO_BORDER);
    groupHeaderCell[5] = new PdfPCell();
    groupHeaderCell[5].setBorder(Rectangle.NO_BORDER);
   
    float[] wfGroupHeader = {
        41,
        18,
        10,
        22,
        17,
        7
      };
    for (PdfPCell pdfPCell : groupHeaderCell) {
      pdfPCell.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
    }

    PdfPTable groupHeaderTable = new PdfPTable(6);
    groupHeaderTable.setWidthPercentage(100f);
    groupHeaderTable.setWidths(wfGroupHeader);
    addCellsToTable(groupHeaderTable,groupHeaderCell);
    addContent(groupHeaderTable);
   
    //Content Header
    PdfPCell[] riskTableHeader = new PdfPCell[16];
    riskTableHeader[0] = new PdfPCell(new Phrase( messageSource.getMessage("FicheST.devis", null, localtion), contentBoldFont));
    riskTableHeader[1] = new PdfPCell(new Phrase( messageSource.getMessage("FicheST.status", null, localtion), contentBoldFont));
    riskTableHeader[2] = new PdfPCell(new Phrase( messageSource.getMessage("pdf.gestiondto.content.libelle", null, localtion), contentBoldFont));
    riskTableHeader[3] = new PdfPCell(new Phrase( messageSource.getMessage("pdf.gestiondto.content.commentaires", null, localtion), contentBoldFont));
    riskTableHeader[4] = new PdfPCell(new Phrase( messageSource.getMessage("pdf.gestiondto.content.montant", null, localtion), contentBoldFont));
    riskTableHeader[5] = new PdfPCell(new Phrase( messageSource.getMessage("pdf.gestiondto.content.marche_avenants", null, localtion), contentBoldFont));
    riskTableHeader[6] = new PdfPCell(new Phrase( messageSource.getMessage("pdf.gestiondto.content.arrete", null, localtion), contentBoldFont));
    riskTableHeader[7] = new PdfPCell(new Phrase( messageSource.getMessage("pdf.gestiondto.content.nonarrete", null, localtion), contentBoldFont));   
    riskTableHeader[8] = new PdfPCell(new Phrase( messageSource.getMessage("pdf.gestiondto.content.provision", null, localtion), contentBoldFont));   
    riskTableHeader[9] = new PdfPCell(new Phrase( messageSource.getMessage("pdf.gestiondto.content.devisrefuse", null, localtion), contentBoldFont));   
    riskTableHeader[10] = new PdfPCell(new Phrase( messageSource.getMessage("pdf.gestiondto.content.totalfdc", null, localtion), contentBoldFont));   
    riskTableHeader[11] = new PdfPCell(new Phrase( messageSource.getMessage("pdf.gestiondto.content.activitereel", null, localtion), contentBoldFont));   
    riskTableHeader[12] = new PdfPCell(new Phrase(messageSource.getMessage("FicheST.type", null, localtion), contentBoldFont));   
    riskTableHeader[13] = new PdfPCell(new Phrase( messageSource.getMessage("pdf.gestiondto.content.libelle_", null, localtion), contentBoldFont));   
    riskTableHeader[14] = new PdfPCell(new Phrase( messageSource.getMessage("pdf.gestiondto.content.montant", null, localtion), contentBoldFont));   
    riskTableHeader[15] = new PdfPCell(new Phrase( messageSource.getMessage("pdf.gestiondto.content.ecart", null, localtion), contentBoldFont));
    for (PdfPCell pdfPCell : riskTableHeader) {
      pdfPCell.setBackgroundColor(new Color(Constants.RED,Constants.GREEN,Constants.BLUE));
      pdfPCell.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
    }
    //End
   
    PdfPTable gestionDtoTable = new PdfPTable(16);
    gestionDtoTable.setWidthPercentage(100f);
    addCellsToTable(gestionDtoTable, riskTableHeader);
    float[] wf = {
        7,  
        7
        7
        15
        5,
        18,
        5,
        5,
        5,
        5,
        7,
        5,
        5,
        7,
        5,
        7
      };
   
    gestionDtoTable.setWidthPercentage(100f);
    gestionDtoTable.setWidths(wf);
   
    //Add Header
    addContent(gestionDtoTable);

    gestionDtoTable.getDefaultCell().setHorizontalAlignment(PdfPCell.ALIGN_LEFT);
   
    String tmp;
    for (int j = 0 ; j < gestions.size();j++) {
      gestionDtoTable = new PdfPTable(16);
      String param = gestions.get(j);
      if(param != null && param.length() > 0){
        String arr[] = param.split(Constants.SEPRATE);
        for(int i=0;i < arr.length;i++){
          tmp = arr[i];// == null ? "" : arr[i];
          gestionDtoTable.addCell(new PdfPCell(new Phrase(tmp.equals("null") ? "" : tmp , contentNormalFont)));
        }
      }
      gestionDtoTable.setWidthPercentage(100f);
      gestionDtoTable.setWidths(wf);
      gestionDtoTable.setSpacingAfter(3f);
View Full Code Here

Examples of com.lowagie.text.Phrase

    addContent(budgetTable);
  }
 
  private PdfPTable addtotalSum(String totalgestions) throws DocumentException {
    PdfPTable gestionDtoTable = new PdfPTable(11);
    PdfPCell gestionDtoCell = new PdfPCell(new Phrase(messageSource.getMessage("pdf.gestiondto.soustotaldumarche",null, localtion), contentBoldFont));
    gestionDtoCell.setHorizontalAlignment(Rectangle.ALIGN_CENTER);
    gestionDtoTable.addCell(gestionDtoCell);
    if(totalgestions != null && totalgestions.length() > 0){
      String[] tmp = totalgestions.split(Constants.SEPRATE);
     
      gestionDtoCell = new PdfPCell(new Phrase(tmp[0] + messageSource.getMessage("pdf.gestiondto.content.euro", null, localtion), contentNormalFont));
      gestionDtoCell.setHorizontalAlignment(Rectangle.ALIGN_RIGHT);
      gestionDtoTable.addCell(gestionDtoCell);
     
      gestionDtoCell = new PdfPCell(new Phrase(tmp[1] + messageSource.getMessage("pdf.gestiondto.content.euro", null, localtion), contentNormalFont));
      gestionDtoCell.setHorizontalAlignment(Rectangle.ALIGN_RIGHT);
      gestionDtoTable.addCell(gestionDtoCell);
     
      gestionDtoCell = new PdfPCell(new Phrase(tmp[2] + messageSource.getMessage("pdf.gestiondto.content.euro", null, localtion), contentNormalFont));
      gestionDtoCell.setHorizontalAlignment(Rectangle.ALIGN_RIGHT);
      gestionDtoTable.addCell(gestionDtoCell);
     
      gestionDtoCell = new PdfPCell(new Phrase(tmp[3] + messageSource.getMessage("pdf.gestiondto.content.euro", null, localtion), contentNormalFont));
      gestionDtoCell.setHorizontalAlignment(Rectangle.ALIGN_RIGHT);
      gestionDtoTable.addCell(gestionDtoCell);
     
      gestionDtoCell = new PdfPCell(new Phrase(tmp[4] + messageSource.getMessage("pdf.gestiondto.content.euro", null, localtion), contentNormalFont));
      gestionDtoCell.setHorizontalAlignment(Rectangle.ALIGN_RIGHT);
      gestionDtoTable.addCell(gestionDtoCell);
     
      gestionDtoCell = new PdfPCell(new Phrase(tmp[5] + messageSource.getMessage("pdf.gestiondto.content.euro", null, localtion), contentNormalFont));
      gestionDtoCell.setHorizontalAlignment(Rectangle.ALIGN_RIGHT);
      gestionDtoTable.addCell(gestionDtoCell);
     
      gestionDtoCell = new PdfPCell(new Phrase(tmp[6] + messageSource.getMessage("pdf.gestiondto.content.euro", null, localtion), contentNormalFont));
      gestionDtoCell.setHorizontalAlignment(Rectangle.ALIGN_RIGHT);
      gestionDtoTable.addCell(gestionDtoCell);
     
      gestionDtoCell = new PdfPCell(new Phrase(tmp[7] + messageSource.getMessage("pdf.gestiondto.content.euro", null, localtion), contentNormalFont));
      gestionDtoCell.setHorizontalAlignment(Rectangle.ALIGN_RIGHT);
      gestionDtoTable.addCell(gestionDtoCell);
     
      gestionDtoCell = new PdfPCell(new Phrase(tmp[8] + messageSource.getMessage("pdf.gestiondto.content.euro", null, localtion), contentNormalFont));
      gestionDtoCell.setHorizontalAlignment(Rectangle.ALIGN_RIGHT);
      gestionDtoTable.addCell(gestionDtoCell);
     
      gestionDtoCell = new PdfPCell(new Phrase(tmp[9] + messageSource.getMessage("pdf.gestiondto.content.euro", null, localtion), contentNormalFont));
      gestionDtoCell.setHorizontalAlignment(Rectangle.ALIGN_RIGHT);
      gestionDtoTable.addCell(gestionDtoCell);
 
      float[] wf = {
          36,
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.