Package com.itextpdf.text

Examples of com.itextpdf.text.Phrase


     * Adds a cell element.
     *
     * @param text the text for the cell
     */
    public void addCell(final String text) {
        addCell(new Phrase(text));
    }
View Full Code Here


            this.image = image;
            column.setLeading(0, 1);
            setPadding(borderWidth / 2);
        }
        else {
            column.addText(this.phrase = new Phrase(new Chunk(image, 0, 0)));
            column.setLeading(0, 1);
            setPadding(0);
        }
    }
View Full Code Here

        for (PdfLine l: lines) {
            float moveTextX = l.indentLeft() - indentLeft() + indentation.indentLeft + indentation.listIndentLeft + indentation.sectionIndentLeft;
            text.moveText(moveTextX, -l.height());
            // is the line preceded by a symbol?
            if (l.listSymbol() != null) {
                ColumnText.showTextAligned(graphics, Element.ALIGN_LEFT, new Phrase(l.listSymbol()), text.getXTLM() - l.listIndent(), text.getYTLM(), 0);
            }

            currentValues[0] = currentFont;

            writeLineToContent(l, text, graphics, currentValues, writer.getSpaceCharRatio());
View Full Code Here

        if (fonts.size() == 0)
            throw new IndexOutOfBoundsException(MessageLocalization.getComposedMessage("no.font.is.defined"));
        char cc[] = text.toCharArray();
        int len = cc.length;
        StringBuffer sb = new StringBuffer();
        Phrase ret = new Phrase();
        currentFont = null;
        for (int k = 0; k < len; ++k) {
            Chunk newChunk = processChar(cc, k, sb);
            if (newChunk != null) {
                ret.add(newChunk);
            }
        }
        if (sb.length() > 0) {
            Chunk ck = new Chunk(sb.toString(), currentFont != null ? currentFont : fonts.get(0));
            ret.add(ck);
        }
        return ret;
    }
View Full Code Here

  private PdfPTable getHeatTable() {
    float[] tableWidth = { 0.07f, 0.45f, 0.28f, 0.20f };
    PdfPTable table = new PdfPTable(tableWidth);

    // add Column titles
    PdfPCell c21 = new PdfPCell(new Phrase("NR", normalHeaderFont));
    c21.setHorizontalAlignment(Element.ALIGN_CENTER);
    c21.setVerticalAlignment(Element.ALIGN_CENTER);
    table.addCell(c21);
    PdfPCell c22 = new PdfPCell(new Phrase("Nume", normalHeaderFont));
    c22.setHorizontalAlignment(Element.ALIGN_CENTER);
    c22.setVerticalAlignment(Element.ALIGN_CENTER);
    table.addCell(c22);
    PdfPCell c23 = new PdfPCell(new Phrase("Club", normalHeaderFont));
    c23.setHorizontalAlignment(Element.ALIGN_CENTER);
    c23.setVerticalAlignment(Element.ALIGN_CENTER);
    table.addCell(c23);
    PdfPCell c24 = new PdfPCell(new Phrase("Timp", normalHeaderFont));
    c24.setHorizontalAlignment(Element.ALIGN_CENTER);
    c24.setVerticalAlignment(Element.ALIGN_CENTER);
    table.addCell(c24);

    // lane 1 cells
    PdfPCell c31 = new PdfPCell(new Phrase(Integer.toString(heat.getLane1().getLaneNumber()), normalFont));
    table.addCell(c31);
    PdfPCell c32 = new PdfPCell(new Phrase(heat.getLane1().getSwimmer().getName(), normalFont));
    table.addCell(c32);
    PdfPCell c33 = new PdfPCell(new Phrase(heat.getLane1().getSwimmer().getClub(), normalFont));
    table.addCell(c33);
    table.addCell(new PdfPCell());

    // lane 2 cells
    PdfPCell c41 = new PdfPCell(new Phrase(Integer.toString(heat.getLane2().getLaneNumber()), normalFont));
    table.addCell(c41);
    PdfPCell c42 = new PdfPCell(new Phrase(heat.getLane2().getSwimmer().getName(), normalFont));
    table.addCell(c42);
    PdfPCell c43 = new PdfPCell(new Phrase(heat.getLane2().getSwimmer().getClub(), normalFont));
    table.addCell(c43);
    table.addCell(new PdfPCell());

    // lane 3 cells
    PdfPCell c51 = new PdfPCell(new Phrase(Integer.toString(heat.getLane3().getLaneNumber()), normalFont));
    table.addCell(c51);
    PdfPCell c52 = new PdfPCell(new Phrase(heat.getLane3().getSwimmer().getName(), normalFont));
    table.addCell(c52);
    PdfPCell c53 = new PdfPCell(new Phrase(heat.getLane3().getSwimmer().getClub(), normalFont));
    table.addCell(c53);
    table.addCell(new PdfPCell());

    // lane 4 cells
    PdfPCell c61 = new PdfPCell(new Phrase(Integer.toString(heat.getLane4().getLaneNumber()), normalFont));
    table.addCell(c61);
    PdfPCell c62 = new PdfPCell(new Phrase(heat.getLane4().getSwimmer().getName(), normalFont));
    table.addCell(c62);
    PdfPCell c63 = new PdfPCell(new Phrase(heat.getLane4().getSwimmer().getClub(), normalFont));
    table.addCell(c63);
    table.addCell(new PdfPCell());

    // lane 5 cells
    PdfPCell c71 = new PdfPCell(new Phrase(Integer.toString(heat.getLane5().getLaneNumber()), normalFont));
    table.addCell(c71);
    PdfPCell c72 = new PdfPCell(new Phrase(heat.getLane5().getSwimmer().getName(), normalFont));
    table.addCell(c72);
    PdfPCell c73 = new PdfPCell(new Phrase(heat.getLane5().getSwimmer().getClub(), normalFont));
    table.addCell(c73);
    table.addCell(new PdfPCell());

    // lane 6 cells
    PdfPCell c81 = new PdfPCell(new Phrase(Integer.toString(heat.getLane6().getLaneNumber()), normalFont));
    table.addCell(c81);
    PdfPCell c82 = new PdfPCell(new Phrase(heat.getLane6().getSwimmer().getName(), normalFont));
    table.addCell(c82);
    PdfPCell c83 = new PdfPCell(new Phrase(heat.getLane6().getSwimmer().getClub(), normalFont));
    table.addCell(c83);
    table.addCell(new PdfPCell());

    if (event.getPoolType().contains("50")) {

      // lane 7 cells
      PdfPCell c91 = new PdfPCell(new Phrase(Integer.toString(heat.getLane7().getLaneNumber()), normalFont));
      table.addCell(c91);
      PdfPCell c92 = new PdfPCell(new Phrase(heat.getLane7().getSwimmer().getName(), normalFont));
      table.addCell(c92);
      PdfPCell c93 = new PdfPCell(new Phrase(heat.getLane7().getSwimmer().getClub(), normalFont));
      table.addCell(c93);
      table.addCell(new PdfPCell());

      // lane 8 cells
      PdfPCell c101 = new PdfPCell(new Phrase(Integer.toString(heat.getLane8().getLaneNumber()), normalFont));
      table.addCell(c101);
      PdfPCell c102 = new PdfPCell(new Phrase(heat.getLane8().getSwimmer().getName(), normalFont));
      table.addCell(c102);
      PdfPCell c103 = new PdfPCell(new Phrase(heat.getLane8().getSwimmer().getClub(), normalFont));
      table.addCell(c103);
      table.addCell(new PdfPCell());
    } // end 50m pool extra lanes

    return table;
View Full Code Here

    int loopNr = 1;

    for (String age : ageGroups) {
      if (operations.searchAgeGroupInResult(results, age, requiredGender)) {
        // Age-group
        PdfPCell c11 = new PdfPCell(new Phrase(getRomanAgeGroup(age) + ". " + age, normalHeaderFont));
        c11.setHorizontalAlignment(Element.ALIGN_LEFT);
        disableBorders(c11);
        c11.setColspan(8);
        table.addCell(c11);

        for (Result res : results) {
          if (res.getSwimmer().getAgeGroup().equals(age)) {
            // add the swimmer

            if (loopNr > 1 && previousResultTime == res.getResultTime()) {
              classification--;
            } else {
              classification = loopNr;
            }

            PdfPCell c21 = new PdfPCell(new Phrase(
                res.getPerformanceStatus().equals("OK") ? Integer.toString(classification) : "",
                normalFont));
            c21.setHorizontalAlignment(Element.ALIGN_CENTER);
            disableBorders(c21);
            table.addCell(c21);
            PdfPCell c22 = new PdfPCell(new Phrase(res.getSwimmer().getName(), normalFont));
            disableBorders(c22);
            table.addCell(c22);
            PdfPCell c23 = new PdfPCell(new Phrase(res.getSwimmer().getClub(), normalFont));
            disableBorders(c23);
            table.addCell(c23);
            PdfPCell c24 = new PdfPCell(new Phrase(res.getSwimmer().getBirthYear(), normalFont));
            disableBorders(c24);
            table.addCell(c24);
            PdfPCell c25 = new PdfPCell(new Phrase(res.getPerformanceStatus().equals("OK") ? padLeft(
                Integer.toString(res.getResultMinutes()), 2)
                + ":"
                + padLeft(Integer.toString(res.getResultSecondes()), 2)
                + ","
                + padLeft(Integer.toString(res.getResultMSeconds()), 2) : "-", normalFont));
            disableBorders(c25);
            table.addCell(c25);
            PdfPCell c26 = new PdfPCell(new Phrase(
                calculations.calculateFinaPoints(res.getSwimTimeSeconds(),
                    calculations.getBaseTimeForEvent(event, age, requiredGender)), normalFont));
            disableBorders(c26);
            table.addCell(c26);
            PdfPCell c27 = new PdfPCell(new Phrase(Integer.toString((!res.getPerformanceStatus().equals(
                "OK") ? 0 : calculations.calculateLocalPoints(classification))), normalFont));
            disableBorders(c27);
            table.addCell(c27);
            PdfPCell c28 = new PdfPCell(new Phrase((res.getPerformanceStatus().equals("OK") ? ""
                : res.getPerformanceStatus()), normalFont));
            disableBorders(c28);
            table.addCell(c28);
            classification++;
            loopNr++;
            previousResultTime = res.getResultTime();
          }
        }

        classification = 1;
        previousResultTime = 99999;
        loopNr = 1;

        // add empty line
        PdfPCell c31 = new PdfPCell(new Phrase(" ", normalHeaderFont));
        c31.setHorizontalAlignment(Element.ALIGN_LEFT);
        disableBorders(c31);
        c31.setColspan(8);
        table.addCell(c31);
View Full Code Here

  private PdfPTable getHeatTable() {
    float[] tableWidth = { 0.04f, 0.36f, 0.30f, 0.14f, 0.16f };
    PdfPTable table = new PdfPTable(tableWidth);

    // add Column titles
    PdfPCell c21 = new PdfPCell(new Phrase("Nr", normalHeaderFont));
    c21.setHorizontalAlignment(Element.ALIGN_CENTER);
    disableBorders(c21);
    table.addCell(c21);
    PdfPCell c22 = new PdfPCell(new Phrase("Nume", normalHeaderFont));
    c21.setHorizontalAlignment(Element.ALIGN_CENTER);
    disableBorders(c22);
    table.addCell(c22);
    PdfPCell c23 = new PdfPCell(new Phrase("Club", normalHeaderFont));
    c21.setHorizontalAlignment(Element.ALIGN_CENTER);
    disableBorders(c23);
    table.addCell(c23);
    PdfPCell c24 = new PdfPCell(new Phrase("Categorie", normalHeaderFont));
    c21.setHorizontalAlignment(Element.ALIGN_CENTER);
    disableBorders(c24);
    table.addCell(c24);
    PdfPCell c25 = new PdfPCell(new Phrase("Timp", normalHeaderFont));
    c21.setHorizontalAlignment(Element.ALIGN_RIGHT);
    disableBorders(c25);
    table.addCell(c25);

    for (Heat heats : heatList) {
      // heat number cell
      PdfPCell c11 = new PdfPCell(new Phrase("Seria " + heats.getHeatNumber(), normalHeaderFont));
      c11.setHorizontalAlignment(Element.ALIGN_CENTER);
      disableBorders(c11);
      c11.setColspan(5);
      table.addCell(c11);

      // lane 1 cells
      PdfPCell c31 = new PdfPCell(new Phrase(Integer.toString(heats.getLane1().getLaneNumber()), normalFont));
      c31.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c31);
      table.addCell(c31);
      PdfPCell c32 = new PdfPCell(new Phrase(heats.getLane1().getSwimmer().getName(), normalFont));
      c32.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c32);
      table.addCell(c32);
      PdfPCell c33 = new PdfPCell(new Phrase(heats.getLane1().getSwimmer().getClub(), normalFont));
      c33.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c33);
      table.addCell(c33);
      PdfPCell c34 = new PdfPCell(new Phrase(heats.getLane1().getSwimmer().getAgeGroup(), normalFont));
      c34.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c34);
      table.addCell(c34);
      PdfPCell c35;
      try {
        c35 = new PdfPCell(new Phrase(padLeft(Integer.toString(heats.getLane1().getEntryMinutes()), 2) + ":"
            + padLeft(Integer.toString(heats.getLane1().getEntrySecondes()), 2) + ","
            + padLeft(Integer.toString(heats.getLane1().getEntryMSeconds()), 2), normalFont));
      } catch (NullPointerException e) {
        c35 = new PdfPCell(new Phrase(""));
      }
      c35.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c35);
      table.addCell(c35);

      // lane 2 cells
      PdfPCell c41 = new PdfPCell(new Phrase(Integer.toString(heats.getLane2().getLaneNumber()), normalFont));
      c41.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c41);
      table.addCell(c41);
      PdfPCell c42 = new PdfPCell(new Phrase(heats.getLane2().getSwimmer().getName(), normalFont));
      c42.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c42);
      table.addCell(c42);
      PdfPCell c43 = new PdfPCell(new Phrase(heats.getLane2().getSwimmer().getClub(), normalFont));
      c43.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c43);
      table.addCell(c43);
      PdfPCell c44 = new PdfPCell(new Phrase(heats.getLane2().getSwimmer().getAgeGroup(), normalFont));
      c44.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c44);
      table.addCell(c44);
      PdfPCell c45;
      try {
        c45 = new PdfPCell(new Phrase(padLeft(Integer.toString(heats.getLane2().getEntryMinutes()), 2) + ":"
            + padLeft(Integer.toString(heats.getLane2().getEntrySecondes()), 2) + ","
            + padLeft(Integer.toString(heats.getLane2().getEntryMSeconds()), 2), normalFont));
      } catch (NullPointerException e) {
        c45 = new PdfPCell(new Phrase(""));
      }
      c45.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c45);
      table.addCell(c45);

      // lane 3 cells
      PdfPCell c51 = new PdfPCell(new Phrase(Integer.toString(heats.getLane3().getLaneNumber()), normalFont));
      c51.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c51);
      table.addCell(c51);
      PdfPCell c52 = new PdfPCell(new Phrase(heats.getLane3().getSwimmer().getName(), normalFont));
      c52.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c52);
      table.addCell(c52);
      PdfPCell c53 = new PdfPCell(new Phrase(heats.getLane3().getSwimmer().getClub(), normalFont));
      c53.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c53);
      table.addCell(c53);
      PdfPCell c54 = new PdfPCell(new Phrase(heats.getLane3().getSwimmer().getAgeGroup(), normalFont));
      c54.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c54);
      table.addCell(c54);
      PdfPCell c55;
      try {
        c55 = new PdfPCell(new Phrase(padLeft(Integer.toString(heats.getLane3().getEntryMinutes()), 2) + ":"
            + padLeft(Integer.toString(heats.getLane3().getEntrySecondes()), 2) + ","
            + padLeft(Integer.toString(heats.getLane3().getEntryMSeconds()), 2), normalFont));
      } catch (NullPointerException e) {
        c55 = new PdfPCell(new Phrase(""));
      }
      c55.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c55);
      table.addCell(c55);

      // lane 4 cells
      PdfPCell c61 = new PdfPCell(new Phrase(Integer.toString(heats.getLane4().getLaneNumber()), normalFont));
      c61.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c61);
      table.addCell(c61);
      PdfPCell c62 = new PdfPCell(new Phrase(heats.getLane4().getSwimmer().getName(), normalFont));
      c62.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c62);
      table.addCell(c62);
      PdfPCell c63 = new PdfPCell(new Phrase(heats.getLane4().getSwimmer().getClub(), normalFont));
      c63.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c63);
      table.addCell(c63);
      PdfPCell c64 = new PdfPCell(new Phrase(heats.getLane4().getSwimmer().getAgeGroup(), normalFont));
      c64.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c64);
      table.addCell(c64);
      PdfPCell c65;
      try {
        c65 = new PdfPCell(new Phrase(padLeft(Integer.toString(heats.getLane4().getEntryMinutes()), 2) + ":"
            + padLeft(Integer.toString(heats.getLane4().getEntrySecondes()), 2) + ","
            + padLeft(Integer.toString(heats.getLane4().getEntryMSeconds()), 2), normalFont));
      } catch (NullPointerException e) {
        c65 = new PdfPCell(new Phrase(""));
      }
      c65.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c65);
      table.addCell(c65);

      // lane 5 cells
      PdfPCell c71 = new PdfPCell(new Phrase(Integer.toString(heats.getLane5().getLaneNumber()), normalFont));
      c71.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c71);
      table.addCell(c71);
      PdfPCell c72 = new PdfPCell(new Phrase(heats.getLane5().getSwimmer().getName(), normalFont));
      c72.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c72);
      table.addCell(c72);
      PdfPCell c73 = new PdfPCell(new Phrase(heats.getLane5().getSwimmer().getClub(), normalFont));
      c73.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c73);
      table.addCell(c73);
      PdfPCell c74 = new PdfPCell(new Phrase(heats.getLane5().getSwimmer().getAgeGroup(), normalFont));
      c74.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c74);
      table.addCell(c74);
      PdfPCell c75;
      try {
        c75 = new PdfPCell(new Phrase(padLeft(Integer.toString(heats.getLane5().getEntryMinutes()), 2) + ":"
            + padLeft(Integer.toString(heats.getLane5().getEntrySecondes()), 2) + ","
            + padLeft(Integer.toString(heats.getLane5().getEntryMSeconds()), 2), normalFont));
      } catch (NullPointerException e) {
        c75 = new PdfPCell(new Phrase(""));
      }
      c75.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c75);
      table.addCell(c75);

      // lane 6 cells
      PdfPCell c81 = new PdfPCell(new Phrase(Integer.toString(heats.getLane6().getLaneNumber()), normalFont));
      c81.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c81);
      table.addCell(c81);
      PdfPCell c82 = new PdfPCell(new Phrase(heats.getLane6().getSwimmer().getName(), normalFont));
      c82.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c82);
      table.addCell(c82);
      PdfPCell c83 = new PdfPCell(new Phrase(heats.getLane6().getSwimmer().getClub(), normalFont));
      c83.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c83);
      table.addCell(c83);
      PdfPCell c84 = new PdfPCell(new Phrase(heats.getLane6().getSwimmer().getAgeGroup(), normalFont));
      c84.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c84);
      table.addCell(c84);
      PdfPCell c85;
      try {
        c85 = new PdfPCell(new Phrase(padLeft(Integer.toString(heats.getLane6().getEntryMinutes()), 2) + ":"
            + padLeft(Integer.toString(heats.getLane6().getEntrySecondes()), 2) + ","
            + padLeft(Integer.toString(heats.getLane6().getEntryMSeconds()), 2), normalFont));
      } catch (NullPointerException e) {
        c85 = new PdfPCell(new Phrase());
      }
      c85.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c85);
      table.addCell(c85);

      if (event.getPoolType().contains("50")) {

        // lane 7 cells
        PdfPCell c91 = new PdfPCell(new Phrase(Integer.toString(heats.getLane7().getLaneNumber()), normalFont));
        c91.setHorizontalAlignment(Element.ALIGN_LEFT);
        disableBorders(c91);
        table.addCell(c91);
        PdfPCell c92 = new PdfPCell(new Phrase(heats.getLane7().getSwimmer().getName(), normalFont));
        c92.setHorizontalAlignment(Element.ALIGN_LEFT);
        disableBorders(c92);
        table.addCell(c92);
        PdfPCell c93 = new PdfPCell(new Phrase(heats.getLane7().getSwimmer().getClub(), normalFont));
        c93.setHorizontalAlignment(Element.ALIGN_LEFT);
        disableBorders(c93);
        table.addCell(c93);
        PdfPCell c94 = new PdfPCell(new Phrase(heats.getLane7().getSwimmer().getAgeGroup(), normalFont));
        c94.setHorizontalAlignment(Element.ALIGN_LEFT);
        disableBorders(c94);
        table.addCell(c94);
        PdfPCell c95;
        try {
          c95 = new PdfPCell(new Phrase(padLeft(Integer.toString(heats.getLane7().getEntryMinutes()), 2)
              + ":" + padLeft(Integer.toString(heats.getLane7().getEntrySecondes()), 2) + ","
              + padLeft(Integer.toString(heats.getLane7().getEntryMSeconds()), 2), normalFont));
          c95.setHorizontalAlignment(Element.ALIGN_LEFT);
        } catch (NullPointerException e) {
          c95 = new PdfPCell(new Phrase(""));
        }
        disableBorders(c95);
        table.addCell(c95);

        // lane 8 cells
        PdfPCell c10_1 = new PdfPCell(
            new Phrase(Integer.toString(heats.getLane8().getLaneNumber()), normalFont));
        c10_1.setHorizontalAlignment(Element.ALIGN_LEFT);
        disableBorders(c10_1);
        table.addCell(c10_1);
        PdfPCell c10_2 = new PdfPCell(new Phrase(heats.getLane8().getSwimmer().getName(), normalFont));
        c10_2.setHorizontalAlignment(Element.ALIGN_LEFT);
        disableBorders(c10_2);
        table.addCell(c10_2);
        PdfPCell c10_3 = new PdfPCell(new Phrase(heats.getLane8().getSwimmer().getClub(), normalFont));
        c10_3.setHorizontalAlignment(Element.ALIGN_LEFT);
        disableBorders(c10_3);
        table.addCell(c10_3);
        PdfPCell c10_4 = new PdfPCell(new Phrase(heats.getLane8().getSwimmer().getAgeGroup(), normalFont));
        c10_4.setHorizontalAlignment(Element.ALIGN_LEFT);
        disableBorders(c10_4);
        table.addCell(c10_4);
        PdfPCell c10_5;
        try {
          c10_5 = new PdfPCell(new Phrase(padLeft(Integer.toString(heats.getLane8().getEntryMinutes()), 2)
              + ":" + padLeft(Integer.toString(heats.getLane8().getEntrySecondes()), 2) + ","
              + padLeft(Integer.toString(heats.getLane8().getEntryMSeconds()), 2), normalFont));
        } catch (NullPointerException e) {
          c10_5 = new PdfPCell(new Phrase(""));
        }
        c10_5.setHorizontalAlignment(Element.ALIGN_LEFT);
        disableBorders(c10_5);
        table.addCell(c10_5);
      } // end 50m pool extra lanes

      // add empty line after each heat
      PdfPCell c11_1 = new PdfPCell(new Phrase(" "));
      c11_1.setHorizontalAlignment(Element.ALIGN_CENTER);
      disableBorders(c11_1);
      table.addCell(c11_1);
      PdfPCell c11_2 = new PdfPCell(new Phrase(" "));
      disableBorders(c11_2);
      table.addCell(c11_2);
      PdfPCell c11_3 = new PdfPCell(new Phrase(" "));
      disableBorders(c11_3);
      table.addCell(c11_3);
      PdfPCell c11_4 = new PdfPCell(new Phrase(" "));
      disableBorders(c11_4);
      table.addCell(c11_4);
      PdfPCell c11_5 = new PdfPCell(new Phrase(" "));
      disableBorders(c11_5);
      table.addCell(c11_5);

    }
View Full Code Here

        for (PdfLine l: lines) {
            float moveTextX = l.indentLeft() - indentLeft() + indentation.indentLeft + indentation.listIndentLeft + indentation.sectionIndentLeft;
            text.moveText(moveTextX, -l.height());
            // is the line preceded by a symbol?
            if (l.listSymbol() != null) {
                ColumnText.showTextAligned(graphics, Element.ALIGN_LEFT, new Phrase(l.listSymbol()), text.getXTLM() - l.listIndent(), text.getYTLM(), 0);
            }

            currentValues[0] = currentFont;

            writeLineToContent(l, text, graphics, currentValues, writer.getSpaceCharRatio());
View Full Code Here

        char cc[] = text.toCharArray();
        int len = cc.length;
        StringBuffer sb = new StringBuffer();
        Font font = null;
        int lastidx = -1;
        Phrase ret = new Phrase();
        for (int k = 0; k < len; ++k) {
            char c = cc[k];
            if (c == '\n' || c == '\r') {
                sb.append(c);
                continue;
            }
            if (Utilities.isSurrogatePair(cc, k)) {
                int u = Utilities.convertToUtf32(cc, k);
                for (int f = 0; f < fsize; ++f) {
                    font = fonts.get(f);
                    if (font.getBaseFont().charExists(u)) {
                        if (lastidx != f) {
                            if (sb.length() > 0 && lastidx != -1) {
                                Chunk ck = new Chunk(sb.toString(), fonts.get(lastidx));
                                ret.add(ck);
                                sb.setLength(0);
                            }
                            lastidx = f;
                        }
                        sb.append(c);
                        sb.append(cc[++k]);
                        break;
                    }
                }
            }
            else {
                for (int f = 0; f < fsize; ++f) {
                    font = fonts.get(f);
                    if (font.getBaseFont().charExists(c)) {
                        if (lastidx != f) {
                            if (sb.length() > 0 && lastidx != -1) {
                                Chunk ck = new Chunk(sb.toString(), fonts.get(lastidx));
                                ret.add(ck);
                                sb.setLength(0);
                            }
                            lastidx = f;
                        }
                        sb.append(c);
                        break;
                    }
                }
            }
        }
        if (sb.length() > 0) {
            Chunk ck = new Chunk(sb.toString(), fonts.get(lastidx == -1 ? 0 : lastidx));
            ret.add(ck);
        }
        return ret;
    }
View Full Code Here

            this.image = image;
            column.setLeading(0, 1);
            setPadding(borderWidth / 2);
        }
        else {
            column.addText(this.phrase = new Phrase(new Chunk(image, 0, 0)));
            column.setLeading(0, 1);
            setPadding(0);
        }
    }
View Full Code Here

TOP

Related Classes of com.itextpdf.text.Phrase

Copyright © 2018 www.massapicom. 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.