iText landscape orientation and positioning?

You’re using PageSize.A4_LANDSCAPE, a variable that was introduced by a contributor and that should have never been added to the main release. Please use PageSize.A4.rotate() instead. It’s not clear what you want to achieve with the lines: document.left(100f); document.top(150f); Those are getters, not setters. It looks as if you’re assuming that PDF is similar to … Read more

How to insert blank lines in PDF?

You can trigger a newline by inserting Chunk.NEWLINE into your document. Here’s an example. public static void main(String args[]) { try { // create a new document Document document = new Document( PageSize.A4, 20, 20, 20, 20 ); PdfWriter.getInstance( document, new FileOutputStream( “HelloWorld.pdf” ) ); document.open(); document.add( new Paragraph( “Hello, World!” ) ); document.add( new … Read more