Package com.lowagie.text

Examples of com.lowagie.text.Font


 
  private PdfPTable exportPDFTable(FacesContext context, DataTable table, boolean pageOnly, int[] excludeColumns, String encoding) {
    List<UIColumn> columns = getColumnsToExport(table, excludeColumns);
      int numberOfColumns = columns.size();
      PdfPTable pdfTable = new PdfPTable(numberOfColumns);
      Font font = FontFactory.getFont(FontFactory.TIMES, encoding);
      Font headerFont = FontFactory.getFont(FontFactory.TIMES, encoding, Font.DEFAULTSIZE, Font.BOLD);
        String rowIndexVar = table.getRowIndexVar();
     
      int first = pageOnly ? table.getFirst() : 0;
      int size = pageOnly ? (first + table.getRows()) : table.getRowCount();
     
View Full Code Here


        Rectangle rect = new Rectangle(160, rectangle.getTop(i * 20), 180, rectangle.getTop(20 + i * 20));
        return rect;
    }

    public static void addBoxDescription(Rectangle rectangle, int i, String[] values, PdfContentByte[] canvases) {
        Font f = new Font();
        f.setSize(ITextInputText.FONTSIZE);
        ColumnText.showTextAligned(canvases[0], Element.ALIGN_LEFT,
                new Phrase(values[i], f), 190, rectangle.getTop(i * 20) - 15, 0);
    }
View Full Code Here

        onOff[1].lineTo(19, 19);
        onOff[1].moveTo(1, 19);
        onOff[1].lineTo(19, 1);
        onOff[1].stroke();
        RadioCheckField checkbox;
        Font f = new Font();
        f.setSize(ITextInputText.FONTSIZE);
        for (int i = 0; i < values.length; i++) {
            try {
                Rectangle rect = ITextRadio.getBoxRectangle(rectangle, i);
                checkbox = new RadioCheckField(writer, rect, UUID.randomUUID().toString(), "Yes");
                boolean checked = false;
View Full Code Here

    public PdfFormBuilderSpace() {
    }

    @Override
    public Element render() {
        Font font = new Font();
        switch (getProperties().getSize()) {
            case 10:
                font.setSize(1);
                break;
            case 30:
                font.setSize(6);
                break;
            case 50:
                font.setSize(10);
                break;
        }
        return new ITextParagraph(new Chunk(" ", font));
    }
View Full Code Here

    }

    @Override
    public Element render() {
        Chunk c = new Chunk(new LineSeparator());
        Font f = new Font();
        f.setSize(2);
        c.setFont(f);
        return c;
    }
View Full Code Here

    public PdfFormBuilderHeading() {
    }

    @Override
    public Element render() {
        Font font = new Font();
        switch (getProperties().getSize()) {
            case 1:
                font.setSize(30);
                break;
            case 2:
                font.setSize(25);
                break;
            case 3:
                font.setSize(20);
                break;
        }
        Chunk chunk = new Chunk(getProperties().getValues(), font);
        return new ITextParagraph(chunk);
    }
View Full Code Here

     * @param chunk The chunk whose content is to be rendered bold.
     * @param color The font color desired.
     */
    private void setBoldStyle(Chunk chunk, Color color)
    {
        Font font = chunk.font();
        chunk.setFont(FontFactory.getFont(font.getFamilyname(), font.size(), Font.BOLD, color));
    }
View Full Code Here

            addCompanyInfo(document);

            document.add(blankSpace());

            //TITTLE
            Paragraph p = new Paragraph("FACTURA", new Font(Font.HELVETICA, 16, Font.BOLD));
            p.setAlignment(Element.ALIGN_CENTER);
            document.add(p);

            document.add(blankSpace());
            document.add(blankSpace());
View Full Code Here

        logo.setAbsolutePosition(20f, 750f);
        document.add(logo);
    }

    public void addCompanyInfo(Document document) throws DocumentException {
        Paragraph p = new Paragraph("Su Arte", new Font(Font.HELVETICA, 9, Font.BOLD));
        p.setAlignment(Element.ALIGN_RIGHT);
        document.add(p);

        // Print date
        String myDate = formatter.format(new Date());
        p = new Paragraph("Impreso: " + myDate, new Font(Font.HELVETICA, 9, Font.NORMAL));
        p.setAlignment(Element.ALIGN_RIGHT);
        document.add(p);

        // Print Fax & phone
        String pbx = "PBX: 2250-7360, Telefax: 2250-7360";
        p = new Paragraph(pbx, new Font(Font.HELVETICA, 9, Font.NORMAL));
        p.setAlignment(Element.ALIGN_RIGHT);
        document.add(p);

        // Print Fax & phone
        String email = "E-mail: suarte@turbonett.com";
        p = new Paragraph(email, new Font(Font.HELVETICA, 9, Font.NORMAL));
        p.setAlignment(Element.ALIGN_RIGHT);
        document.add(p);
    }
View Full Code Here

        PdfPTable header = new PdfPTable(widths);

        header.setWidthPercentage(100);
        header.getDefaultCell().setBorder(0);

        Paragraph p = new Paragraph("Factura no.: ", new Font(Font.HELVETICA, 12, Font.NORMAL));
        p.setAlignment(Element.ALIGN_LEFT);
        header.addCell(p);

        p = new Paragraph(invoice.getId().toString(), new Font(Font.HELVETICA, 12, Font.NORMAL));
        p.setAlignment(Element.ALIGN_LEFT);
        header.addCell(p);

        p = new Paragraph("Moneda: " + invoice.getCurrency().getDescription(), new Font(Font.HELVETICA, 12, Font.NORMAL));
        p.setAlignment(Element.ALIGN_LEFT);
        header.addCell(p);

        p = new Paragraph("Empresa: ", new Font(Font.HELVETICA, 12, Font.NORMAL));
        p.setAlignment(Element.ALIGN_LEFT);
        header.addCell(p);

        String companyName = invoice.getCompany().getDescription();
        p = new Paragraph(companyName, new Font(Font.HELVETICA, 12, Font.NORMAL));
        p.setAlignment(Element.ALIGN_LEFT);
        header.addCell(p);
       
        header.addCell(new Paragraph(""));

        p = new Paragraph("Cotizacion: ", new Font(Font.HELVETICA, 12, Font.NORMAL));
        p.setAlignment(Element.ALIGN_LEFT);
        header.addCell(p);

        String quotationId = invoice.getQuotation().getId().toString();
        p = new Paragraph(quotationId, new Font(Font.HELVETICA, 12, Font.NORMAL));
        p.setAlignment(Element.ALIGN_LEFT);
        header.addCell(p);

        header.addCell(new Paragraph(""));

        p = new Paragraph("Descripcion: ", new Font(Font.HELVETICA, 12, Font.NORMAL));
        p.setAlignment(Element.ALIGN_LEFT);
        header.addCell(p);

        String description = invoice.getDescription();
        p = new Paragraph(description, new Font(Font.HELVETICA, 12, Font.NORMAL));
        p.setAlignment(Element.ALIGN_LEFT);
        header.getDefaultCell().setColspan(2);
        header.addCell(p);

        p = new Paragraph("Fecha de expiracion: ", new Font(Font.HELVETICA, 12, Font.NORMAL));
        p.setAlignment(Element.ALIGN_LEFT);
        header.getDefaultCell().setColspan(0);
        header.addCell(p);

        String expiration = simpleFormat.format(invoice.getExpirationDate());
        p = new Paragraph(expiration, new Font(Font.HELVETICA, 12, Font.NORMAL));
        p.setAlignment(Element.ALIGN_LEFT);
        header.addCell(p);
       
        header.addCell(new Paragraph(""));
View Full Code Here

TOP

Related Classes of com.lowagie.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.