Package com.lowagie.text

Examples of com.lowagie.text.Font


        header.setWidthPercentage(100);
        header.getDefaultCell().setBorder(PdfPCell.LEFT | PdfPCell.RIGHT | PdfPCell.BOTTOM | PdfPCell.TOP);
        header.getDefaultCell().setGrayFill(0.8f);

        Paragraph p = new Paragraph("Producto", new Font(Font.HELVETICA, 11, Font.NORMAL));
        header.addCell(p);

        p = new Paragraph("Resolucion", new Font(Font.HELVETICA, 11, Font.NORMAL));
        header.addCell(p);

        p = new Paragraph("Tipo Trabajo", new Font(Font.HELVETICA, 11, Font.NORMAL));
        header.addCell(p);

        p = new Paragraph("Precio", new Font(Font.HELVETICA, 11, Font.NORMAL));
        header.addCell(p);

        p = new Paragraph("Cant.", new Font(Font.HELVETICA, 11, Font.NORMAL));
        header.addCell(p);

        p = new Paragraph("Total", new Font(Font.HELVETICA, 11, Font.NORMAL));
        header.addCell(p);

        document.add(header);
    }
View Full Code Here


        header.getDefaultCell().setBorder(PdfPCell.LEFT | PdfPCell.RIGHT | PdfPCell.BOTTOM | PdfPCell.TOP);
        header.getDefaultCell().setGrayFill(0f);

        for (InvoiceDetail detail : invoice.getDetails()) {
            header.getDefaultCell().setHorizontalAlignment(Element.ALIGN_LEFT);
            Paragraph p = new Paragraph(detail.getQuotationDetail().getProduct().getDescription(), new Font(Font.HELVETICA, 11, Font.NORMAL));
            header.addCell(p);

            p = new Paragraph(detail.getQuotationDetail().getProduct().getResolution().getDescription(), new Font(Font.HELVETICA, 11, Font.NORMAL));
            header.addCell(p);

            p = new Paragraph(detail.getQuotationDetail().getProduct().getWorkType().getDescription(), new Font(Font.HELVETICA, 11, Font.NORMAL));
            header.addCell(p);

            header.getDefaultCell().setHorizontalAlignment(Element.ALIGN_RIGHT);
            p = new Paragraph(detail.getQuotationDetail().getPrice().toString(), new Font(Font.HELVETICA, 11, Font.NORMAL));
            header.addCell(p);

            p = new Paragraph(detail.getQuotationDetail().getQuantity().toString(), new Font(Font.HELVETICA, 11, Font.NORMAL));
            header.addCell(p);

            p = new Paragraph(detail.getQuotationDetail().getSubTotal().toString(), new Font(Font.HELVETICA, 11, Font.NORMAL));
            header.addCell(p);
        }

        header.getDefaultCell().setColspan(5);
        header.addCell(blankSpace());
        //Footer
        header.getDefaultCell().setColspan(0);
        String currencySymbol = invoice.getCurrency().getSymbol();
        header.getDefaultCell().setHorizontalAlignment(Element.ALIGN_RIGHT);
        header.getDefaultCell().setBorder(0);

        Paragraph t = new Paragraph("SubTotal: ", new Font(Font.HELVETICA, 11, Font.NORMAL));
        header.getDefaultCell().setColspan(4);
        header.addCell(t);

        t = new Paragraph(currencySymbol, new Font(Font.HELVETICA, 11, Font.NORMAL));
        header.getDefaultCell().setColspan(0);
        header.addCell(t);

        t = new Paragraph(invoice.getSubTotal().toString(), new Font(Font.HELVETICA, 11, Font.NORMAL));
        header.getDefaultCell().setColspan(0);
        header.addCell(t);

        t = new Paragraph("Impuesto: ", new Font(Font.HELVETICA, 11, Font.NORMAL));
        header.getDefaultCell().setColspan(4);
        header.addCell(t);

        t = new Paragraph(currencySymbol, new Font(Font.HELVETICA, 11, Font.NORMAL));
        header.getDefaultCell().setColspan(0);
        header.addCell(t);

        t = new Paragraph(invoice.getTax().toString(), new Font(Font.HELVETICA, 11, Font.NORMAL));
        header.getDefaultCell().setColspan(0);
        header.addCell(t);

        t = new Paragraph("Total: ", new Font(Font.HELVETICA, 11, Font.NORMAL));
        header.getDefaultCell().setColspan(4);
        header.addCell(t);

        t = new Paragraph(currencySymbol, new Font(Font.HELVETICA, 11, Font.NORMAL));
        header.getDefaultCell().setColspan(0);
        header.addCell(t);

        t = new Paragraph(invoice.getTotal().toString(), new Font(Font.HELVETICA, 11, Font.NORMAL));
        header.getDefaultCell().setColspan(0);
        header.addCell(t);

        document.add(header);
    }
View Full Code Here

            addCompanyInfo(document);

            document.add(blankSpace());

            //TITTLE
            Paragraph p = new Paragraph("COTIZACION", 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

       
        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: info@suarte.com";
        p = new Paragraph(email, new Font(Font.HELVETICA, 9, Font.NORMAL));
        p.setAlignment(Element.ALIGN_RIGHT);
        document.add(p);
    }
View Full Code Here

        // Line 1
        header.addCell(new Paragraph(""));
        header.addCell(new Paragraph(""));

        Paragraph p = new Paragraph("Cotizacion no.: ", new Font(Font.HELVETICA, 12, Font.NORMAL));
        header.getDefaultCell().setHorizontalAlignment(Element.ALIGN_RIGHT);
        header.addCell(p);

        p = new Paragraph(quotation.getId().toString(), new Font(Font.HELVETICA, 12, Font.NORMAL));
        header.getDefaultCell().setHorizontalAlignment(Element.ALIGN_LEFT);
        header.addCell(p);

        // Line 2
        header.addCell(new Paragraph(""));
        header.addCell(new Paragraph(""));

        p = new Paragraph("Fecha: ", new Font(Font.HELVETICA, 12, Font.NORMAL));
        header.getDefaultCell().setHorizontalAlignment(Element.ALIGN_RIGHT);
        header.addCell(p);

        String quotationDate = simpleFormat.format(quotation.getTransDate());
        p = new Paragraph(quotationDate, new Font(Font.HELVETICA, 12, Font.NORMAL));
        header.getDefaultCell().setHorizontalAlignment(Element.ALIGN_LEFT);
        header.addCell(p);

        // Line 3
        p = new Paragraph("Empresa: ", new Font(Font.HELVETICA, 12, Font.NORMAL));
        header.getDefaultCell().setHorizontalAlignment(Element.ALIGN_LEFT);
        header.addCell(p);

        String companyName = quotation.getCompany().getDescription();
        p = new Paragraph(companyName, new Font(Font.HELVETICA, 12, Font.NORMAL));
        header.getDefaultCell().setHorizontalAlignment(Element.ALIGN_LEFT);
        header.addCell(p);

        p = new Paragraph("Moneda: ", new Font(Font.HELVETICA, 12, Font.NORMAL));
        header.getDefaultCell().setHorizontalAlignment(Element.ALIGN_RIGHT);
        header.addCell(p);

        p = new Paragraph(quotation.getCurrency().getDescription(), new Font(Font.HELVETICA, 12, Font.NORMAL));
        header.getDefaultCell().setHorizontalAlignment(Element.ALIGN_LEFT);
        header.addCell(p);

        // Line 4
        p = new Paragraph("Contacto: ", new Font(Font.HELVETICA, 12, Font.NORMAL));
        header.getDefaultCell().setHorizontalAlignment(Element.ALIGN_LEFT);
        header.addCell(p);
       
        String firstName = quotation.getContact().getFirstName();
        String lastName = quotation.getContact().getLastName();
        String contactName = quotation.getContact().toString();
        p = new Paragraph(contactName, new Font(Font.HELVETICA, 12, Font.NORMAL));
        header.getDefaultCell().setHorizontalAlignment(Element.ALIGN_LEFT);
        header.addCell(p);

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

        // Line 5
        p = new Paragraph("Telefono: ", new Font(Font.HELVETICA, 12, Font.NORMAL));
        header.getDefaultCell().setHorizontalAlignment(Element.ALIGN_LEFT);
        header.addCell(p);

        String phone = quotation.getCompany().getPhone();
        p = new Paragraph(phone, new Font(Font.HELVETICA, 12, Font.NORMAL));
        header.getDefaultCell().setHorizontalAlignment(Element.ALIGN_LEFT);
        header.addCell(p);

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

        // Line 6
        p = new Paragraph("Fax: ", new Font(Font.HELVETICA, 12, Font.NORMAL));
        header.getDefaultCell().setHorizontalAlignment(Element.ALIGN_LEFT);
        header.addCell(p);

        String fax = quotation.getCompany().getFax();
        p = new Paragraph(fax, new Font(Font.HELVETICA, 12, Font.NORMAL));
        header.getDefaultCell().setHorizontalAlignment(Element.ALIGN_LEFT);
        header.addCell(p);

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

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

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

        document.add(header);
View Full Code Here

        header.setWidthPercentage(100);
        header.getDefaultCell().setBorder(PdfPCell.LEFT | PdfPCell.RIGHT | PdfPCell.BOTTOM | PdfPCell.TOP);
        header.getDefaultCell().setGrayFill(0.8f);

        Paragraph p = new Paragraph("Producto", new Font(Font.HELVETICA, 11, Font.NORMAL));
        header.addCell(p);

        p = new Paragraph("Resolucion", new Font(Font.HELVETICA, 11, Font.NORMAL));
        header.addCell(p);

        p = new Paragraph("Tipo Trabajo", new Font(Font.HELVETICA, 11, Font.NORMAL));
        header.addCell(p);

        p = new Paragraph("Precio", new Font(Font.HELVETICA, 11, Font.NORMAL));
        header.addCell(p);

        p = new Paragraph("Cant.", new Font(Font.HELVETICA, 11, Font.NORMAL));
        header.addCell(p);

        p = new Paragraph("Total", new Font(Font.HELVETICA, 11, Font.NORMAL));
        header.addCell(p);

        document.add(header);
    }
View Full Code Here

        header.getDefaultCell().setGrayFill(0f);

        for (QuotationDetail detail : quotation.getDetails()) {
            header.getDefaultCell().setHorizontalAlignment(Element.ALIGN_LEFT);
            String description = detail.getProduct() != null ? detail.getProduct().getDescription() : detail.getItemDescription();
            Paragraph p = new Paragraph(description, new Font(Font.HELVETICA, 11, Font.NORMAL));
            header.addCell(p);

            String resolution = detail.getProduct() != null ? detail.getProduct().getResolution().getDescription() : null;
            p = new Paragraph(resolution, new Font(Font.HELVETICA, 11, Font.NORMAL));
            header.addCell(p);

            String workType = detail.getProduct() != null ? detail.getProduct().getWorkType().getDescription() : null;
            p = new Paragraph(workType, new Font(Font.HELVETICA, 11, Font.NORMAL));
            header.addCell(p);

            header.getDefaultCell().setHorizontalAlignment(Element.ALIGN_RIGHT);
            p = new Paragraph(numberFormat.format(detail.getPrice()), new Font(Font.HELVETICA, 11, Font.NORMAL));
            header.addCell(p);

            p = new Paragraph(numberFormat.format(detail.getQuantity()), new Font(Font.HELVETICA, 11, Font.NORMAL));
            header.addCell(p);

            p = new Paragraph(numberFormat.format(detail.getSubTotal()), new Font(Font.HELVETICA, 11, Font.NORMAL));
            header.addCell(p);
        }

        header.getDefaultCell().setBorder(0);
        header.getDefaultCell().setColspan(6);
        header.addCell(blankSpace());
        //Footer
        header.getDefaultCell().setColspan(0);
        String currencySymbol = quotation.getCurrency().getSymbol();
        header.getDefaultCell().setHorizontalAlignment(Element.ALIGN_RIGHT);

        Paragraph t = new Paragraph("SubTotal: ", new Font(Font.HELVETICA, 11, Font.NORMAL));
        header.getDefaultCell().setColspan(4);
        header.addCell(t);

        t = new Paragraph(currencySymbol, new Font(Font.HELVETICA, 11, Font.NORMAL));
        header.getDefaultCell().setColspan(0);
        header.addCell(t);

        t = new Paragraph(numberFormat.format(quotation.getSubtotal()), new Font(Font.HELVETICA, 11, Font.NORMAL));
        header.addCell(t);

        t = new Paragraph("Impuesto: ", new Font(Font.HELVETICA, 11, Font.NORMAL));
        header.getDefaultCell().setColspan(4);
        header.addCell(t);

        t = new Paragraph(currencySymbol, new Font(Font.HELVETICA, 11, Font.NORMAL));
        header.getDefaultCell().setColspan(0);
        header.addCell(t);

        t = new Paragraph(numberFormat.format(quotation.getTax()), new Font(Font.HELVETICA, 11, Font.NORMAL));
        header.addCell(t);

        t = new Paragraph("Total: ", new Font(Font.HELVETICA, 11, Font.NORMAL));
        header.getDefaultCell().setColspan(4);
        header.addCell(t);

        t = new Paragraph(currencySymbol, new Font(Font.HELVETICA, 11, Font.NORMAL));
        header.getDefaultCell().setColspan(0);
        header.addCell(t);

        t = new Paragraph(numberFormat.format(quotation.getTotalCost()), new Font(Font.HELVETICA, 11, Font.NORMAL));
        header.addCell(t);

        document.add(header);
    }
View Full Code Here

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

        // Line 1
        Paragraph p = new Paragraph("Forma de pago: ", new Font(Font.HELVETICA, 10, Font.NORMAL));
        header.getDefaultCell().setHorizontalAlignment(Element.ALIGN_LEFT);
        header.addCell(p);

        p = new Paragraph(quotation.getPaymentMethod().getDescription(), new Font(Font.HELVETICA, 10, Font.NORMAL));
        header.getDefaultCell().setHorizontalAlignment(Element.ALIGN_LEFT);
        header.addCell(p);

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

        // Line 2
        p = new Paragraph("Garantia: ", new Font(Font.HELVETICA, 10, Font.NORMAL));
        header.getDefaultCell().setHorizontalAlignment(Element.ALIGN_LEFT);
        header.addCell(p);

        String guarantee = quotation.getGuarantee() != null ? quotation.getGuarantee().getDescription() : null;
        p = new Paragraph(guarantee, new Font(Font.HELVETICA, 10, Font.NORMAL));
        header.getDefaultCell().setHorizontalAlignment(Element.ALIGN_LEFT);
        header.addCell(p);

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

        // Line 3
        header.getDefaultCell().setColspan(3);
        header.addCell(new Paragraph(" "));
        header.getDefaultCell().setColspan(3);
        header.addCell(new Paragraph(" "));

        // Line 4
        p = new Paragraph("Agradeciendo su atencion y esperando poder servirle como usted se merece; ", new Font(Font.HELVETICA, 12, Font.NORMAL));
        header.getDefaultCell().setHorizontalAlignment(Element.ALIGN_LEFT);
        header.getDefaultCell().setColspan(3);
        header.addCell(p);

        // Line 5
        header.getDefaultCell().setColspan(3);
        header.addCell(new Paragraph(" "));
        header.getDefaultCell().setColspan(3);
        header.addCell(new Paragraph(" "));

        // Line 6
        header.getDefaultCell().setColspan(0);
        header.getDefaultCell().setBorder(PdfPCell.TOP);
        p = new Paragraph("Ing. Xochilt T. Rocha", new Font(Font.HELVETICA, 12, Font.NORMAL));
        header.getDefaultCell().setHorizontalAlignment(Element.ALIGN_LEFT);
        header.getDefaultCell().setColspan(2);
        header.addCell(p);

        header.getDefaultCell().setBorder(PdfPCell.TOP);
        p = new Paragraph("Aceptado por el cliente", new Font(Font.HELVETICA, 12, Font.NORMAL));
        header.getDefaultCell().setHorizontalAlignment(Element.ALIGN_LEFT);
        header.getDefaultCell().setColspan(2);
        header.addCell(p);

        document.add(header);
View Full Code Here

        header.getDefaultCell().setBorder(0);

        header.addCell(blankSpace());

        // Amount
        Paragraph p = new Paragraph("          " + paymentAmount, new Font(Font.HELVETICA, 12, Font.NORMAL));
        p.setAlignment(Element.ALIGN_RIGHT);
        header.addCell(p);

        // Date
        header.getDefaultCell().setColspan(2);
        String paymentDate = simpleFormat.format(payment.getDate());
        p = new Paragraph(paymentDate, new Font(Font.HELVETICA, 12, Font.NORMAL));
        p.setAlignment(Element.ALIGN_LEFT);
        header.addCell(p);
       
        // Blank Line
        header.addCell(blankSpace());
       
        // Recibimos de line: Company
        String companyName = payment.getCompany().getDescription();
        p = new Paragraph("                  " + companyName, new Font(Font.HELVETICA, 12, Font.NORMAL));
        p.setAlignment(Element.ALIGN_LEFT);
        header.addCell(p);
       
        // Blank Line
        header.addCell(blankSpace());

        // La cantidad de: Amount
        Long entireAmount = Long.valueOf(paymentAmount.substring(0, paymentAmount.indexOf(".")));
        String cents = paymentAmount.substring(paymentAmount.indexOf(".") + 1, paymentAmount.length());
        Long centsAmount = cents.length() == 1 ? Long.valueOf(cents) * 10 : Long.valueOf(cents);
        String amountDescription = numberToLetters.toLetras(entireAmount) + " " + currencyDescription;
        String centsDescription = centsAmount != 0 ? numberToLetters.toLetras(centsAmount) : null;

        // First line
        header.getDefaultCell().setColspan(2);
        p = new Paragraph("                  " + amountDescription, new Font(Font.HELVETICA, 12, Font.NORMAL));
        p.setAlignment(Element.ALIGN_LEFT);
        header.getDefaultCell().setColspan(2);
        header.addCell(p);
       
        // Blank Line
        header.addCell(blankSpace());

        // Second line
        if (centsDescription != null) {
            header.getDefaultCell().setColspan(2);
            p = new Paragraph("con " + centsDescription, new Font(Font.HELVETICA, 12, Font.NORMAL));
            p.setAlignment(Element.ALIGN_LEFT);
            header.getDefaultCell().setColspan(2);
            header.addCell(p);
        }
       
        // Blank Line
        header.addCell(blankSpace());

        // Concepto
        header.getDefaultCell().setColspan(2);
        String description = payment.getDescription();
        p = new Paragraph("                  " + description, new Font(Font.HELVETICA, 12, Font.NORMAL));
        p.setAlignment(Element.ALIGN_LEFT);
        header.getDefaultCell().setColspan(2);
        header.addCell(p);
       
        // Blank Line (8)
        header.addCell(blankSpace());
        header.addCell(blankSpace());
        header.addCell(blankSpace());
        header.addCell(blankSpace());
        header.addCell(blankSpace());
        header.addCell(blankSpace());
        header.addCell(blankSpace());

        // Check or efective
        header.getDefaultCell().setColspan(2);
        String type = payment.getType().toString();
        if (type.equals("Efectivo")) {
            p = new Paragraph("          ex", new Font(Font.HELVETICA, 12, Font.NORMAL));
            p.setAlignment(Element.ALIGN_LEFT);
            header.addCell(p);
        } else if (type.equals("Cheque")) {
            // Additional line
            header.addCell(blankSpace());
            header.addCell(blankSpace());
            p = new Paragraph("          cx", new Font(Font.HELVETICA, 12, Font.NORMAL));
            p.setAlignment(Element.ALIGN_LEFT);
            header.addCell(p);
        }
        document.add(header);
    }
View Full Code Here

  }

  private static void addCellaNormale(PdfPTable table, String testo, int align) throws BadElementException {
    Paragraph p = new Paragraph();
    p.add(new Phrase(testo, new Font(Font.HELVETICA, 8, Font.NORMAL)));
    p.setAlignment(align);
    PdfPCell cell = new PdfPCell(p);
    cell.setBorderWidth(0f);
    cell.setHorizontalAlignment(align);
    table.addCell(cell);
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.