Document doc = new Document(); ByteArrayOutputStream baosPDF = new ByteArrayOutputStream(); PdfWriter docWriter = null; docWriter = PdfWriter.getInstance(doc, baosPDF); // ... 用add方法把内容添加到Document中。 doc.add(new Paragraph( "This document was created by a class named: " + this.getClass().getName()));
doc.add(new Paragraph( "This document was created on " + new java.util.Date()));