Example usage for com.itextpdf.text Document addCreationDate

List of usage examples for com.itextpdf.text Document addCreationDate

Introduction

In this page you can find the example usage for com.itextpdf.text Document addCreationDate.

Prototype


public boolean addCreationDate() 

Source Link

Document

Adds the current date and time to a Document.

Usage

From source file:lk.score.androphsy.report.ReportPdf.java

License:Open Source License

private void addMetaData(Document document) {
    document.addTitle("lk.score.androphsy.main.Androspy Reporting");
    document.addSubject("Evidence Report");
    document.addKeywords("lk.score.androphsy.main.Androspy, Evidence");
    document.addCreator("lk.score.androphsy.main.Androspy");
    document.addAuthor(AndrospyMain.gb_username);
    document.addCreationDate();

}

From source file:mobac.program.atlascreators.PaperAtlasPdf.java

License:Open Source License

private Document createDocument(Rectangle r) throws MapCreationException {
    File pdfFile = new File(getLayerFolder(), map.getName() + ".pdf");
    float left = (float) s.marginLeft;
    float right = (float) s.marginRight;
    float top = (float) s.marginTop;
    float bottom = (float) s.marginBottom;
    Document document = new Document(r, left, right, top, bottom);
    PdfWriter pdfWriter;/*from  w  w w.  jav  a2s  .  com*/
    try {
        pdfFile.createNewFile();
        pdfWriter = PdfWriter.getInstance(document, new FileOutputStream(pdfFile));
    } catch (IOException e) {
        throw new MapCreationException(map, e);
    } catch (DocumentException e) {
        throw new MapCreationException(map, e);
    }
    pdfWriter.setCompressionLevel(s.compression);
    document.open();
    document.addAuthor(ProgramInfo.PROG_NAME);
    document.addCreationDate();
    document.addCreator(ProgramInfo.PROG_NAME);
    document.addProducer();
    return document;
}

From source file:Modelo.RelatoriosBEAN.java

public static void relatorioTopJogos() throws FileNotFoundException, DocumentException {
    String path = System.getProperty("user.home") + FRMEmitirRelatorios.local + ".pdf";
    Document document = new Document(PageSize.LETTER);
    PdfWriter.getInstance(document, new FileOutputStream(path));
    document.open();/*from w ww. j a v  a  2 s. c  om*/
    document.addAuthor("TechSales");
    document.addCreator("TechSales");
    document.addSubject("TechSales - Sistema de gerenciamento de locadoras");
    document.addCreationDate();
    document.addTitle("TechSales");

    HTMLWorker htmlWorker = new HTMLWorker(document);

    String frase;
    try {
        frase = "<html>" + "<head> <meta charset=\"utf-8\"> </head>" + "<body>" + "<br/>"
                + "<h1 align=center>Relatrio de Jogos mais vendidos</h1>" + "<br/><br/>"
                + "<table BORDER RULES=rows border=0 style=\"  width:100%; \">\n" + "<tr> "
                + "<th align=center><strong>Cdigo</strong></th> "
                + "<th align=center><strong>Nome do Jogo</strong></th> "
                + "<th align=center><strong>Quantidade Vendida</strong></th> "
                + "<th align=center><strong>Valor Total</strong></th> " + "</tr> ";
        for (JogoBEAN j : jDAO.topJogos()) {
            frase += "<tr align=center><td>" + j.getJoCodigo() + "</td><td>" + j.getJoNome() + "</td><td>"
                    + j.getJoQtd() + "</td><td>" + j.getJoPrecoPadrao() + "</td></tr>";
        }
        frase += "</table>";
        frase += "</body></html>";
        htmlWorker.parse(new StringReader(frase));
        document.close();
        if (Desktop.isDesktopSupported()) {
            try {
                Desktop.getDesktop().open(new File(path));
            } catch (Exception e) {
                JOptionPane.showMessageDialog(null, e);
            }
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}

From source file:Modelo.RelatoriosBEAN.java

public static void relatorioWorstJogos() throws FileNotFoundException, DocumentException {
    String path = System.getProperty("user.home") + FRMEmitirRelatorios.local + ".pdf";
    Document document = new Document(PageSize.LETTER);
    PdfWriter.getInstance(document, new FileOutputStream(path));
    document.open();//  w ww. j av  a  2 s.  c  o  m
    document.addAuthor("TechSales");
    document.addCreator("TechSales");
    document.addSubject("TechSales - Sistema de gerenciamento de locadoras");
    document.addCreationDate();
    document.addTitle("TechSales");

    HTMLWorker htmlWorker = new HTMLWorker(document);

    String frase;
    try {
        frase = "<html>" + "<head> <meta charset=\"utf-8\"> </head>" + "<body>" + "<br/>"
                + "<h1 align=center>Relatrio de Jogos menos vendidos </h1>" + "<br/><br/>"
                + "<table BORDER RULES=rows border=0 style=\"  width:100%; \">\n" + "<tr> "
                + "<th align=center><strong>Cdigo</strong></th> "
                + "<th align=center><strong>Nome do Jogo</strong></th> "
                + "<th align=center><strong>Quantidade Vendida</strong></th> "
                + "<th align=center><strong>Valor Total</strong></th> " + "</tr> ";
        for (JogoBEAN j : jDAO.worstJogos()) {
            frase += "<tr align=center><td>" + j.getJoCodigo() + "</td><td>" + j.getJoNome() + "</td><td>"
                    + j.getJoQtd() + "</td><td>" + j.getJoPrecoPadrao() + "</td></tr>";
        }
        frase += "</table>";
        frase += "</body></html>";
        htmlWorker.parse(new StringReader(frase));
        document.close();
        if (Desktop.isDesktopSupported()) {
            try {
                Desktop.getDesktop().open(new File(path));
            } catch (Exception e) {
                JOptionPane.showMessageDialog(null, e);
            }
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}

From source file:Modelo.RelatoriosBEAN.java

public static void relatorioTopAlugueis() throws FileNotFoundException, DocumentException {
    String path = System.getProperty("user.home") + FRMEmitirRelatorios.local + ".pdf";
    Document document = new Document(PageSize.LETTER);
    PdfWriter.getInstance(document, new FileOutputStream(path));
    document.open();/*  www  . j a va2s  .  c  o  m*/
    document.addAuthor("TechSales");
    document.addCreator("TechSales");
    document.addSubject("TechSales - Sistema de gerenciamento de locadoras");
    document.addCreationDate();
    document.addTitle("TechSales");

    HTMLWorker htmlWorker = new HTMLWorker(document);

    String frase;
    try {
        frase = "<html>" + "<head> <meta charset=\"utf-8\"> </head>" + "<body>" + "<br/>"
                + "<h1 align=center>Relatrio de Jogos mais Alugados </h1>" + "<br/><br/>"
                + "<table BORDER RULES=rows border=0 style=\"  width:100%; \">\n" + "<tr> "
                + "<th align=center><strong>Cdigo</strong></th> "
                + "<th align=center><strong>Nome do Jogo</strong></th> "
                + "<th align=center><strong>Quantidade Alugada</strong></th> "
                + "<th align=center><strong>Valor Total</strong></th> " + "</tr> ";
        for (JogoBEAN j : jDAO.topAluguelJogos()) {
            frase += "<tr align=center><td>" + j.getJoCodigo() + "</td><td>" + j.getJoNome() + "</td><td>"
                    + j.getJoQtd() + "</td><td>" + j.getJoPrecoPadrao() + "</td></tr>";
        }
        frase += "</table>";
        frase += "</body></html>";
        htmlWorker.parse(new StringReader(frase));
        document.close();
        if (Desktop.isDesktopSupported()) {
            try {
                Desktop.getDesktop().open(new File(path));
            } catch (Exception e) {
                JOptionPane.showMessageDialog(null, e);
            }
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}

From source file:Modelo.RelatoriosBEAN.java

public static void relatorioWorstAlugueis() throws FileNotFoundException, DocumentException {
    String path = System.getProperty("user.home") + FRMEmitirRelatorios.local + ".pdf";
    Document document = new Document(PageSize.LETTER);
    PdfWriter.getInstance(document, new FileOutputStream(path));
    document.open();//from ww w  .  j a v  a 2 s  .c om
    document.addAuthor("TechSales");
    document.addCreator("TechSales");
    document.addSubject("TechSales - Sistema de gerenciamento de locadoras");
    document.addCreationDate();
    document.addTitle("TechSales");

    HTMLWorker htmlWorker = new HTMLWorker(document);

    String frase;
    try {
        frase = "<html>" + "<head> <meta charset=\"utf-8\"> </head>" + "<body>" + "<br/>"
                + "<h1 align=center>Relatrio de Jogos menos Alugados </h1>" + "<br/><br/>"
                + "<table BORDER RULES=rows border=0 style=\"  width:100%; \">\n" + "<tr> "
                + "<th align=center><strong>Cdigo</strong></th> "
                + "<th align=center><strong>Nome do Jogo</strong></th> "
                + "<th align=center><strong>Quantidade Vendida</strong></th> "
                + "<th align=center><strong>Valor Total</strong></th> " + "</tr> ";
        for (JogoBEAN j : jDAO.topAluguelJogos()) {
            frase += "<tr align=center><td>" + j.getJoCodigo() + "</td><td>" + j.getJoNome() + "</td><td>"
                    + j.getJoQtd() + "</td><td>" + j.getJoPrecoPadrao() + "</td></tr>";
        }
        frase += "</table>";
        frase += "</body></html>";
        htmlWorker.parse(new StringReader(frase));
        document.close();
        if (Desktop.isDesktopSupported()) {
            try {
                Desktop.getDesktop().open(new File(path));
            } catch (Exception e) {
                JOptionPane.showMessageDialog(null, e);
            }
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}

From source file:Modelo.RelatoriosBEAN.java

public static void relatorioCompras() throws FileNotFoundException, DocumentException {
    String path = System.getProperty("user.home") + FRMEmitirRelatorios.local + ".pdf";
    Document document = new Document(PageSize.A4.rotate());
    PdfWriter.getInstance(document, new FileOutputStream(path));
    document.open();//from  ww w .ja  v  a 2s  .c  o m
    document.addAuthor("TechSales");
    document.addCreator("TechSales");
    document.addSubject("TechSales - Sistema de gerenciamento de locadoras");
    document.addCreationDate();
    document.addTitle("TechSales");

    HTMLWorker htmlWorker = new HTMLWorker(document);

    String frase;
    try {
        frase = "<html>" + "<head> <meta charset=\"utf-8\"> </head>" + "<body>" + "<br/>"
                + "<h1 align=center>Relatrio de Jogos Comprados </h1>" + "<br/><br/>"
                + "<table BORDER RULES=rows border=0 style=\"  width:100%; \">\n" + "<tr> "
                + "<th align=center><strong>Cdigo</strong></th> "
                + "<th align=center><strong>Custo Unitrio</strong></th> "
                + "<th align=center><strong>Data</strong></th> "
                + "<th align=center><strong>Valor da Entrada</strong></th> "
                + "<th align=center><strong>Nmero de parcelas</strong></th> "
                + "<th align=center><strong>Preo Total</strong></th> "
                + "<th align=center><strong>Quantidade Compradra</strong></th> "
                + "<th align=center><strong>Caixa</strong></th> "
                + "<th align=center><strong>Jogo</strong></th> " + "</tr> ";
        for (NotaDecompraBEAN n : cNdc.listarALL()) {
            frase += "<tr align=center><td>" + n.getNdcCodigo() + "</td><td>" + n.getNdcCustoUnitario()
                    + "</td><td>" + n.getNdcData() + "</td><td>" + n.getNdcEntrada() + "</td><td>"
                    + n.getNdcParcelas() + "</td><td>" + n.getNdcPrecoTotal() + "</td><td>"
                    + n.getNdcQtdComprada() + "</td><td>" + n.getCaixa().getCaixaCodigo() + "</td><td>"
                    + n.getJogo().getJoNome() + "</td></tr>";
        }
        frase += "</table>";
        frase += "</body></html>";
        htmlWorker.parse(new StringReader(frase));
        document.close();
        if (Desktop.isDesktopSupported()) {
            try {
                Desktop.getDesktop().open(new File(path));
            } catch (Exception e) {
                JOptionPane.showMessageDialog(null, e);
            }
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}

From source file:Modelo.RelatoriosBEAN.java

public static void relatorioContas() throws FileNotFoundException, DocumentException {
    String path = System.getProperty("user.home") + FRMEmitirRelatorios.local + ".pdf";
    Document document = new Document(PageSize.A4.rotate());
    PdfWriter.getInstance(document, new FileOutputStream(path));
    document.open();//from  w ww.  j a  v a  2  s. com
    document.addAuthor("TechSales");
    document.addCreator("TechSales");
    document.addSubject("TechSales - Sistema de gerenciamento de locadoras");
    document.addCreationDate();
    document.addTitle("TechSales");

    HTMLWorker htmlWorker = new HTMLWorker(document);

    String frase;
    try {
        frase = "<html>" + "<head> <meta charset=\"utf-8\"> </head>" + "<body>" + "<br/>"
                + "<h1 align=center>Relatrio de Contas </h1>" + "<br/><br/>"
                + "<table BORDER RULES=rows border=0 style=\"  width:100%; \">\n" + "<tr> "
                + "<th align=center><strong>Cdigo</strong></th> "
                + "<th align=center><strong>Data</strong></th> "
                + "<th align=center><strong>Valor da Entrada</strong></th> "
                + "<th align=center><strong>Nmero de parcelas</strong></th> "
                + "<th align=center><strong>Preo Total</strong></th> "
                + "<th align=center><strong>Descrio</strong></th> "
                + "<th align=center><strong>Fornecedor</strong></th> "
                + "<th align=center><strong>Caixa</strong></th> " + "</tr> ";
        for (ContaBEAN n : cContas.listarALL()) {
            frase += "<tr align=center><td>" + n.getConCodigo() + "</td><td>" + n.getConData() + "</td><td>"
                    + n.getConEntrada() + "</td><td>" + n.getConNparcelas() + "</td><td>" + n.getConValorTotal()
                    + "</td><td>" + n.getConDescricao() + "</td><td>" + n.getFornecedor().getForNomeEmpresa()
                    + "</td><td>" + n.getCaixa().getCaixaCodigo() + "</td></tr>";
        }
        frase += "</table>";
        frase += "</body></html>";
        htmlWorker.parse(new StringReader(frase));
        document.close();
        if (Desktop.isDesktopSupported()) {
            try {
                Desktop.getDesktop().open(new File(path));
            } catch (Exception e) {
                JOptionPane.showMessageDialog(null, e);
            }
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}

From source file:Modelo.RelatoriosBEAN.java

public static void relatorioMontanteVendedor() throws FileNotFoundException, DocumentException {
    String path = System.getProperty("user.home") + FRMEmitirRelatorios.local + ".pdf";
    Document document = new Document(PageSize.A4.rotate());
    PdfWriter.getInstance(document, new FileOutputStream(path));
    document.open();//from   w  w  w.  j  a va2s.c  o m
    document.addAuthor("TechSales");
    document.addCreator("TechSales");
    document.addSubject("TechSales - Sistema de gerenciamento de locadoras");
    document.addCreationDate();
    document.addTitle("TechSales");

    HTMLWorker htmlWorker = new HTMLWorker(document);

    String frase;
    try {
        frase = "<html>" + "<head> <meta charset=\"utf-8\"> </head>" + "<body>" + "<br/>"
                + "<h1 align=center>Relatrio de montante por vendedor</h1>" + "<br/><br/>"
                + "<table BORDER RULES=rows border=0 style=\"  width:100%; \">\n" + "<tr> "
                + "<th align=center><strong>Cdigo do funcionario</strong></th> "
                + "<th align=center><strong>Nome do funcionario</strong></th> "
                + "<th align=center><strong>Nmero de vendas</strong></th> "
                + "<th align=center><strong>Valor total das vendas</strong></th> "
                + "<th align=center><strong>Quantidade de alugueis</strong></th> "
                + "<th align=center><strong>Valor total de alugueis</strong></th> "
                + "<th align=center><strong>Montante Total</strong></th> " + "</tr> ";
        for (MontanteBEAN j : jDAO.montanteVendedor()) {
            frase += "<tr align=center><td>" + j.getFunCodigo() + "</td><td>" + j.getFunNome() + "</td><td>"
                    + j.getnVendas() + "</td><td>" + j.getValorVendas() + "</td><td>" + j.getnAluguel()
                    + "</td><td>" + j.getValorAluguel() + "</td><td>" + j.getValorTotal() + "</td></tr>";
        }
        frase += "</table>";
        frase += "</body></html>";
        htmlWorker.parse(new StringReader(frase));
        document.close();
        if (Desktop.isDesktopSupported()) {
            try {
                Desktop.getDesktop().open(new File(path));
            } catch (Exception e) {
                JOptionPane.showMessageDialog(null, e);
            }
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}

From source file:Modelo.RelatoriosBEAN.java

public static void relatorioVendaJogoPeriodo(String s, String dI, String dF)
        throws FileNotFoundException, DocumentException {
    String path = System.getProperty("user.home") + FRMEmitirRelatorios.local + ".pdf";
    Document document = new Document(PageSize.LETTER);
    PdfWriter.getInstance(document, new FileOutputStream(path));
    document.open();/*  w  ww.j av a 2  s .  c o m*/
    document.addAuthor("TechSales");
    document.addCreator("TechSales");
    document.addSubject("TechSales - Sistema de gerenciamento de locadoras");
    document.addCreationDate();
    document.addTitle("TechSales");

    HTMLWorker htmlWorker = new HTMLWorker(document);

    String frase;
    try {
        frase = "<html>" + "<head> <meta charset=\"utf-8\"> </head>" + "<body>"
                + "<h1 align=center>Relatrio de Jogos vendidos</h1>" + "<br/>"
                + "<h3 align=center>Perodo de " + dI + " a " + dF + "</h3>" + "<br/><br/>"
                + "<table BORDER RULES=rows border=0 style=\"  width:100%; \">\n" + "<tr> "
                + "<th align=center><strong>Cdigo do jogo</strong></th> "
                + "<th align=center><strong>Nome do jogo</strong></th> "
                + "<th align=center><strong>Nmero de vendas</strong></th> "
                + "<th align=center><strong>Valor total das vendas</strong></th> " + "</tr> ";
        for (JogoBEAN j : jDAO.vendaPorPeriodo(s)) {
            frase += "<tr align=center><td>" + j.getJoCodigo() + "</td><td>" + j.getJoNome() + "</td><td>"
                    + j.getJoQtd() + "</td><td>" + j.getJoPrecoPadrao() + "</td></tr>";
        }
        frase += "</table>";
        frase += "</body></html>";
        htmlWorker.parse(new StringReader(frase));
        document.close();
        if (Desktop.isDesktopSupported()) {
            try {
                Desktop.getDesktop().open(new File(path));
            } catch (Exception e) {
                JOptionPane.showMessageDialog(null, e);
            }
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}