You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by Steve Pamel <st...@yahoo.com.INVALID> on 2015/10/28 21:15:48 UTC
PDFBox 2.0
Hi-
I'm trying to create multiple text lines on a PDF file.
PDPage page = new PDPage(); doc.addPage(page); PDFont font = PDType1Font.HELVETICA; PDPageContentStream contents = new PDPageContentStream(doc, page); contents.beginText(); contents.setFont(font, 11); contents.newLineAtOffset(vendorx,vendory); int vlen=vendorLineLength; vlen=vlen-vendor.length(); String spaces = new String(new char[vlen]).replace('\0', ' '); vendor=vendor+spaces; contents.showText(vendor); contents.endText(); contents.close(); The above prints a vendor on one line. How do I simply print a list (one vendor on each line)
Appreciate any help you can provide.
Steve
PDFBox 2.0
Posted by Steve Pamel <st...@yahoo.com.INVALID>.
Hi-
I'm trying to create multiple text lines on a PDF file.
PDPage page = new PDPage(); doc.addPage(page); PDFont font = PDType1Font.HELVETICA; PDPageContentStream contents = new PDPageContentStream(doc, page); contents.beginText(); contents.setFont(font, 11); contents.newLineAtOffset(vendorx,vendory); int vlen=vendorLineLength; vlen=vlen-vendor.length(); String spaces = new String(new char[vlen]).replace('\0', ' '); vendor=vendor+spaces; contents.showText(vendor); contents.endText(); contents.close(); The above prints a vendor on one line. How do I simply print a list (one vendor on each line)
Appreciate any help you can provide.
Steve