Revision: 72659
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at October 12, 2017 21:14 by markt22
Initial Code
/** * @param args the command line arguments * @throws java.io.IOException */ public static void main(String[] args) throws IOException { PDDocument document = new PDDocument(); PDPage page = new PDPage(PDRectangle.A4); document.addPage(page); PDPageContentStream contentStream = new PDPageContentStream(document, page); contentStream.beginText(); contentStream.setFont(PDType1Font.TIMES_ROMAN, 12); contentStream.setLeading(15f); contentStream.newLineAtOffset(25, 500); contentStream.showText("First Line"); contentStream.newLine(); contentStream.showText("Second Line"); contentStream.endText(); contentStream.close(); document.save(""); document.close(); }
Initial URL
Initial Description
Creates a new document with a single page, and adds two lines of text to it.
Initial Title
PDFBox: Add multiple lines of text to a page
Initial Tags
Initial Language
Java