Example usage for com.itextpdf.text FontFactory TIMES_ITALIC

List of usage examples for com.itextpdf.text FontFactory TIMES_ITALIC

Introduction

In this page you can find the example usage for com.itextpdf.text FontFactory TIMES_ITALIC.

Prototype

String TIMES_ITALIC

To view the source code for com.itextpdf.text FontFactory TIMES_ITALIC.

Click Source Link

Document

This is a possible value of a base 14 type 1 font

Usage

From source file:helpers.PDFHeaderFooter.java

@Override
public void onStartPage(PdfWriter writer, Document document) {
    Rectangle rect = writer.getBoxSize("art");
    ColumnText.showTextAligned(writer.getDirectContent(), Element.ALIGN_CENTER, new Phrase(""), rect.getLeft(),
            rect.getTop(), 0);/*  w w w  .  ja  va 2s . c o m*/
    ColumnText.showTextAligned(writer.getDirectContent(), Element.ALIGN_CENTER,
            new Phrase("Page " + document.getPageNumber(),
                    FontFactory.getFont(FontFactory.TIMES_ITALIC, 5, Font.ITALIC, BaseColor.BLACK)),
            rect.getRight(), rect.getTop(), 0);
}

From source file:jfx_horario.jefatura.JefaturaController.java

private void crearPdf(File fichero, int opcion) {
    // mtodo para generar un pdf
    try {/*from   w  ww .j a v  a2  s  .c o m*/
        OutputStream file = new FileOutputStream(fichero);
        Document document = new Document();
        PdfWriter.getInstance(document, file);
        document.open();
        Font titleFont = FontFactory.getFont(FontFactory.TIMES_BOLD, 18, BaseColor.BLACK);
        Paragraph docTitle = new Paragraph((String) comboProfes.getSelectionModel().getSelectedItem(),
                titleFont);
        document.add(docTitle);
        Font textH1 = FontFactory.getFont(FontFactory.TIMES_ITALIC, 14, BaseColor.BLACK);
        switch (opcion) {
        case 0:
            crearTablaEnPDF(document, textH1);
            break;
        case 1:
            crearListaClasesDiariasPDF(document, textH1);
            break;
        case 2:
            crearTablaEnPDF(document, textH1);
            crearListaClasesDiariasPDF(document, textH1);
            break;
        }
        document.close();
        file.close();
    } catch (Exception e) {
        e.printStackTrace();
    }
}