title: How to generate multiple lines in PDF using Apache pdfbox
body: <p>I am using Pdfbox to generate PDF files using Java. The problem is that when i add long text contents in the document, it is not displayed properly. Only a part of it is displayed. That too in a single line.</p>
  
  <p>I want text to be in multiple lines.</p>
  
  <p>My code is given below:</p>
  
  <pre><code>PDPageContentStream pdfContent=new PDPageContentStream(pdfDocument, pdfPage, true, true);
  
  pdfContent.beginText();
  pdfContent.setFont(pdfFont, 11);
  pdfContent.moveTextPositionByAmount(30,750);            
  pdfContent.drawString("I am trying to create a PDF file with a lot of text contents in the document. I am using PDFBox");
  pdfContent.endText();
  </code></pre>
  
  <p>My output:</p>
  
  <p><img src="https://i.stack.imgur.com/1IePg.png" alt="This is my output file"></p>