Example usage for com.itextpdf.text BaseColor PINK

List of usage examples for com.itextpdf.text BaseColor PINK

Introduction

In this page you can find the example usage for com.itextpdf.text BaseColor PINK.

Prototype

BaseColor PINK

To view the source code for com.itextpdf.text BaseColor PINK.

Click Source Link

Usage

From source file:br.com.ifrn.panfleto.gui.PainelCadastrar.java

public BaseColor corPagina() {
    if (comboxSelecionarCorPainelGerarPdf.getSelectedItem().equals("Branco")) {
        return BaseColor.WHITE;
    } else if (comboxSelecionarCorPainelGerarPdf.getSelectedItem().equals("Preto")) {
        return BaseColor.BLACK;
    } else if (comboxSelecionarCorPainelGerarPdf.getSelectedItem().equals("Azul")) {
        return BaseColor.BLUE;
    } else if (comboxSelecionarCorPainelGerarPdf.getSelectedItem().equals("Cinza Escuro")) {
        return BaseColor.DARK_GRAY;
    } else if (comboxSelecionarCorPainelGerarPdf.getSelectedItem().equals("Cinza")) {
        return BaseColor.GRAY;
    } else if (comboxSelecionarCorPainelGerarPdf.getSelectedItem().equals("Cinza Claro")) {
        return BaseColor.LIGHT_GRAY;
    } else if (comboxSelecionarCorPainelGerarPdf.getSelectedItem().equals("Magenta")) {
        return BaseColor.MAGENTA;
    } else if (comboxSelecionarCorPainelGerarPdf.getSelectedItem().equals("Laranja")) {
        return BaseColor.ORANGE;
    } else if (comboxSelecionarCorPainelGerarPdf.getSelectedItem().equals("Rosa")) {
        return BaseColor.PINK;
    } else if (comboxSelecionarCorPainelGerarPdf.getSelectedItem().equals("Vermlho")) {
        return BaseColor.RED;
    } else if (comboxSelecionarCorPainelGerarPdf.getSelectedItem().equals("Amarero")) {
        return BaseColor.YELLOW;
    } else if (comboxSelecionarCorPainelGerarPdf.getSelectedItem().equals("Cyan")) {
        return BaseColor.CYAN;
    }//from   w  w  w  .  j av a 2s  . co m

    return BaseColor.WHITE;
}

From source file:Sales.SalesController.java

@FXML
private void PrintReciept(MouseEvent event) {
    try {/*from   www  . ja  v  a 2  s  . c o m*/
        Image im = Image.getInstance("khamals.png");
        FileOutputStream sa = new FileOutputStream("Reciept.pdf");
        im.scaleAbsolute(150f, 150f);
        // im.setAbsolutePosition(25,50);
        im.setBackgroundColor(BaseColor.PINK);
        Document doc = new Document(PageSize.A4, 50, 50, 50, 50);
        PdfWriter writer = PdfWriter.getInstance(doc, sa);
        PdfPTable table = new PdfPTable(6);
        String sh = "                                     Date and Time Of Sale : "
                + Calendar.getInstance().getTime().toGMTString() + "\n\n";
        String header = "                                                                 KHAMALS \n"
                + "                                              DESIGNER AND SHOWROOM EXPERT \n "
                + "                                  MOLYKO BUEA  LAST FLOOR ECKO BANK BUILDING\n ";
        String metda = "    INVOICE NUMBER :" + this.RecieptId.getText() + " \n " + "  SALES PERSON ID :"
                + this.CashierName.getText() + " \n   CUSTOMER NAME :" + this.CustomerName.getText() + "\n\n";

        PdfPCell cell = new PdfPCell(new Phrase("\nRECIEPT"));
        cell.setColspan(6);
        cell.setHorizontalAlignment(2);
        doc.open();
        doc.add(im);
        doc.add(cell);
        System.out.println(doc.leftMargin());
        doc.add(new Paragraph(header));
        doc.add(new Paragraph(sh));
        doc.add(new Paragraph(metda));
        table.addCell("S/N");
        table.addCell("PRODUCT NAME");
        table.addCell("DESCRIPTION");
        table.addCell("QUANTITY");
        table.addCell("UNIT PRICE");
        table.addCell("TOTAL PRICE");
        table.setTotalWidth(1000000);
        for (int i = 0; i < Cart.getItems().size(); i++) {
            table.addCell(this.idex.getCellData(i).toString());
            table.addCell(this.p.getCellData(i).toString());
            table.addCell(this.dsc.getCellData(i).toString());
            table.addCell(this.qt.getCellData(i).toString());
            table.addCell(this.p.getCellData(i).toString());
            table.addCell(this.tp.getCellData(i).toString());
        }

        String footer = " \n                                                                                 Total Amount:         "
                + tot.getText() + ""
                + "                                                                                   SIGNATURES \n"
                + "\nCUSTOMER                                      SALES PERSON ";

        doc.add(table);
        doc.add(new Paragraph(footer));
        doc.addCreationDate();
        doc.addAuthor(this.CashierName.getText());
        doc.close();

        Desktop.getDesktop().open(new File("Reciept.pdf"));

    } catch (Exception sd) {
        System.out.println("Error Message :" + sd.getMessage());
    } finally {

    }

}