Package com.itextpdf.text

Examples of com.itextpdf.text.Font


    }

    private Phrase composePhrase(String text, BaseFont ufont, BaseColor color, float fontSize) {
        Phrase phrase = null;
        if (extensionFont == null && (substitutionFonts == null || substitutionFonts.isEmpty()))
            phrase = new Phrase(new Chunk(text, new Font(ufont, fontSize, 0, color)));
        else {
            FontSelector fs = new FontSelector();
            fs.addFont(new Font(ufont, fontSize, 0, color));
            if (extensionFont != null)
                fs.addFont(new Font(extensionFont, fontSize, 0, color));
            if (substitutionFonts != null) {
                for (int k = 0; k < substitutionFonts.size(); ++k)
                    fs.addFont(new Font(substitutionFonts.get(k), fontSize, 0, color));
            }
            phrase = fs.process(text);
        }
        return phrase;
    }
View Full Code Here


   * @param value die Zahl.
   * @return die erzeugte Zelle.
   */
  public PdfPCell getDetailCell(double value)
  {
    Font f = FontFactory.getFont(FontFactory.HELVETICA, 8f, Font.NORMAL, value >= 0.01d ? BaseColor.BLACK : BaseColor.RED);
    PdfPCell cell = new PdfPCell(new Phrase(HBCI.DECIMALFORMAT.format(value), f));
    cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
    return cell;
  }
View Full Code Here

            }
        }

        table.addCell(imageL);
        Chunk par = new Chunk(this.reportSettingsProperties.loadTitle());
        par.setFont(new Font(this.fontMapper.awtToPdf(this.reportSettingsProperties.loadTitleFont())));
        Paragraph enc = new Paragraph(par);
        enc.setAlignment(Element.ALIGN_CENTER);
        PdfPCell cell = new PdfPCell();
        cell.addElement(enc);
        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
View Full Code Here

    @Override
    protected void buildPatientInfo(Analysis analysis) throws DocumentException {

        Patient patient = analysis.getPatient();
        Chunk pat = new Chunk(EntityDescriptions.PATIENT + ": " + patient.getFullName());
        pat.setFont(new Font(Font.FontFamily.TIMES_ROMAN, 14, Font.BOLD));
        this.document.add(pat);
        this.document.add(Chunk.NEWLINE);
        this.document.add(Chunk.NEWLINE);

        Medic medic = analysis.getMedic();
        if (medic != null) {
            Chunk med = new Chunk(ReportTexts.request_by + medic.getFullName());
            med.setFont(new Font(Font.FontFamily.TIMES_ROMAN, 12, Font.BOLD));
            this.document.add(med);
            this.writeEmptyLine();
        }

        int amount = this.getAmountOfData();

        if (amount > 0) {
            PdfPTable patientTable = new PdfPTable(amount);
            patientTable.setWidthPercentage(90);

            Font title = new Font(this.fontMapper.awtToPdf(this.reportSettingsProperties.loadDataFont()));
            Font value = new Font(this.fontMapper.awtToPdf(this.reportSettingsProperties.loadDataValueFont()));

            // PUT HEADERS

            if (this.reportSettingsProperties.loadUseAge()) {
                Chunk a = new Chunk("Edad");
View Full Code Here

    }

    @Override
    protected void buildParamsInfo(Analysis analysis, Report report, AnalysisResult analysisResult) throws DocumentException {

        Font indexFont = new Font(fontMapper.awtToPdf(this.reportSettingsProperties.loadIndexFont()));
        Font indexValueFont = new Font(fontMapper.awtToPdf(this.reportSettingsProperties.loadIndexValueFont()));

        int amount = this.getAmountOfIndex();

        if (amount > 0) {
View Full Code Here

            float[] widithPlot = {0.5f, 1.5f};
            PdfPTable tablePlot = new PdfPTable(widithPlot);
            tablePlot.setWidthPercentage(70);
            tablePlot.setHorizontalAlignment(Element.ALIGN_CENTER);
            Chunk plot = new Chunk(this.reportSettingsProperties.loadPlotTitle());
            plot.setFont(new Font(fontMapper.awtToPdf(this.reportSettingsProperties.loadPlotFont())));
            PdfPCell plotTitle = new PdfPCell(new Paragraph(plot));

            plotTitle.setVerticalAlignment(Element.ALIGN_MIDDLE);
            plotTitle.setHorizontalAlignment(Element.ALIGN_CENTER);
            tablePlot.addCell(plotTitle);
View Full Code Here

        this.writeEmptyLine();
    }

    @Override
    protected void buildConclusions(Analysis analysis, Report report) throws DocumentException {
        Font titleFont = new Font(fontMapper.awtToPdf(this.reportSettingsProperties.loadBodyTextTitleFont()));
        Font textFont = new Font(fontMapper.awtToPdf(this.reportSettingsProperties.loadBodyTextFont()));

        if ((report.getComments() != null) && (!report.getComments().isEmpty())) {
            Chunk coment = new Chunk(EntityDescriptions.COMMENTS + ":" + System.getProperty("line.separator"));
            coment.setFont(titleFont);
            this.document.add(coment);
            Chunk coments = new Chunk(report.getComments());
            coments.setFont(textFont);
            this.document.add(coments);
            this.writeEmptyLine();
        }

        boolean iarEmpty = ((report.getCommentIAR() == null) || (report.getCommentIAR().isEmpty()));
        boolean aosEmpty = (report.getCommentAOS() == null) || (report.getCommentAOS().isEmpty());
        boolean aodEmpty = ((report.getCommentAOD() == null) || (report.getCommentAOD().isEmpty()));

        if ((!iarEmpty) || (!aodEmpty) || (!aosEmpty)) {

            Chunk indice = new Chunk(EntityDescriptions.INDEXS + ":" + System.getProperty("line.separator"));
            indice.setFont(titleFont);
            this.document.add(indice);
            this.document.add(new Paragraph());

            int samples = 0;
            try {
                AverageByDecade averageByDecade = FacadeDB.getInstance().getAveragesBroker().getAverageByPatient(analysis.getPatient());
                if (averageByDecade != null) {
                    samples = averageByDecade.getSamples();
                }
            } catch (ExceptionDAO aO) {
                //
            }

            Chunk detail = new Chunk(ReportTexts.ideal_characteristics + System.getProperty("line.separator")
                    + ReportTexts.values_to + analysis.getPatient().getDecade() + ReportTexts.decade_and_averages + String.valueOf(samples) + System.getProperty("line.separator"));
            Font detailFont = new Font(fontMapper.awtToPdf(this.reportSettingsProperties.loadBodyTextFont().deriveFont(Font.ITALIC, textFont.getSize() - 2)));
            detail.setFont(detailFont);

            this.document.add(detail);

            if (!iarEmpty) {
View Full Code Here

    public PDFFontWrapper(String fontFamilyName, int fontSize, int fontStyle, PDFBaseColorWrapper baseColorWrapper) {
        this.fontFamily = Font.FontFamily.valueOf(fontFamilyName);
        this.fontSize = fontSize;
        this.fontStyle = fontStyle;
        this.baseColor = baseColorWrapper;
        this.font = new Font(fontFamily, fontSize, fontStyle, baseColorWrapper.getBaseColor());
    }
View Full Code Here

     
      table.setHorizontalAlignment(Element.ALIGN_LEFT);
    document.add(table);
    document.add(new Paragraph("\n", getDefaultFont()));
    final String titleStr = "Invoice ("+Util.ReportDateFormat.format(start)+" - "+Util.ReportDateFormat.format(end)+")";
    final Font f = getDefaultBoldFont();
    f.setSize(14);
    final Paragraph title = new Paragraph(titleStr, f);
    title.setAlignment(Element.ALIGN_CENTER);
    document.add(title);
    document.add(new Paragraph("\n", getDefaultFont()));
  }
View Full Code Here

      return FontFactory.getFont(getFontPath(fontname, fontType),
          encoding, embedded, size, style, color);
    } catch (IOException e) {
      logger.error(e.getMessage(), e);
    }
    return new Font();
  }
View Full Code Here

TOP

Related Classes of com.itextpdf.text.Font

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.