Search in sources :

Example 16 with Document

use of com.lowagie.text.Document in project dhis2-core by dhis2.

the class GridUtils method toPdf.

/**
     * Writes a PDF representation of the given list of Grids to the given OutputStream.
     */
public static void toPdf(List<Grid> grids, OutputStream out) {
    if (hasNonEmptyGrid(grids)) {
        Document document = openDocument(out);
        for (Grid grid : grids) {
            toPdfInternal(grid, document, 40F);
        }
        addPdfTimestamp(document, false);
        closeDocument(document);
    }
}
Also used : Grid(org.hisp.dhis.common.Grid) PDFUtils.addTableToDocument(org.hisp.dhis.system.util.PDFUtils.addTableToDocument) PDFUtils.openDocument(org.hisp.dhis.system.util.PDFUtils.openDocument) Document(com.lowagie.text.Document) PDFUtils.closeDocument(org.hisp.dhis.system.util.PDFUtils.closeDocument)

Aggregations

Document (com.lowagie.text.Document)16 DocumentException (com.lowagie.text.DocumentException)8 Paragraph (com.lowagie.text.Paragraph)8 PdfWriter (com.lowagie.text.pdf.PdfWriter)7 ByteArrayOutputStream (java.io.ByteArrayOutputStream)6 ServletOutputStream (javax.servlet.ServletOutputStream)5 Font (com.lowagie.text.Font)3 PdfContentByte (com.lowagie.text.pdf.PdfContentByte)3 Color (java.awt.Color)3 DiscrepancyNoteBean (org.akaza.openclinica.bean.managestudy.DiscrepancyNoteBean)3 HeaderFooter (com.lowagie.text.HeaderFooter)2 Phrase (com.lowagie.text.Phrase)2 DefaultFontMapper (com.lowagie.text.pdf.DefaultFontMapper)2 PdfTemplate (com.lowagie.text.pdf.PdfTemplate)2 Rectangle2D (java.awt.geom.Rectangle2D)2 FileOutputStream (java.io.FileOutputStream)2 Date (java.util.Date)2 PdfFormFontSettings (org.hisp.dhis.dxf2.pdfform.PdfFormFontSettings)2 PDFUtils.addTableToDocument (org.hisp.dhis.system.util.PDFUtils.addTableToDocument)2 PDFUtils.closeDocument (org.hisp.dhis.system.util.PDFUtils.closeDocument)2