use of com.lowagie.text.Document in project dhis2-core by dhis2.
the class PDFUtils method openDocument.
/**
* Creates a document.
*
* @param outputStream The output stream to write the document content.
* @param pageSize the page size.
* @return A Document.
*/
public static Document openDocument(OutputStream outputStream, Rectangle pageSize) {
try {
Document document = new Document(pageSize);
PdfWriter.getInstance(document, outputStream);
document.open();
return document;
} catch (DocumentException ex) {
throw new RuntimeException("Failed to open PDF document", ex);
}
}
Aggregations