Search in sources :

Example 51 with PdfFont

use of com.itextpdf.kernel.font.PdfFont in project ComponentManagement by Bac3Phi.

the class InventoriesReportController method addDate.

private void addDate(Document document) throws IOException {
    Paragraph date;
    date = new Paragraph("Tháng: " + cbbMonth.getSelectionModel().getSelectedItem() + "/2018");
    // Setting font of the text
    PdfFont font = PdfFontFactory.createFont(FontConstants.TIMES_ROMAN);
    date.setFont(font);
    date.setFontSize(12);
    date.setTextAlignment(TextAlignment.CENTER);
    document.add(date);
}
Also used : PdfFont(com.itextpdf.kernel.font.PdfFont) Paragraph(com.itextpdf.layout.element.Paragraph)

Aggregations

PdfFont (com.itextpdf.kernel.font.PdfFont)51 PdfDocument (com.itextpdf.kernel.pdf.PdfDocument)45 PdfWriter (com.itextpdf.kernel.pdf.PdfWriter)45 Paragraph (com.itextpdf.layout.element.Paragraph)45 Document (com.itextpdf.layout.Document)39 HyphenationConfig (com.itextpdf.layout.hyphenation.HyphenationConfig)29 BufferedReader (java.io.BufferedReader)24 FileReader (java.io.FileReader)24 AreaBreak (com.itextpdf.layout.element.AreaBreak)17 Rectangle (com.itextpdf.kernel.geom.Rectangle)12 Text (com.itextpdf.layout.element.Text)10 PdfPage (com.itextpdf.kernel.pdf.PdfPage)8 DottedLine (com.itextpdf.kernel.pdf.canvas.draw.DottedLine)8 Div (com.itextpdf.layout.element.Div)8 ArrayList (java.util.ArrayList)8 PdfCanvas (com.itextpdf.kernel.pdf.canvas.PdfCanvas)7 Tab (com.itextpdf.layout.element.Tab)7 TabStop (com.itextpdf.layout.element.TabStop)7 Canvas (com.itextpdf.layout.Canvas)6 ColumnDocumentRenderer (com.itextpdf.layout.ColumnDocumentRenderer)6