title: Text going off page while using pdfmake library
body: <p>I am using pdfmake to get users to fill out a form and the data from that form is taken and converted into a PDF. But the issue is when a user types in a long text the text goes off page. </p>
  
  <p>I have tried settings style to justify but that does not seem to work.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html lang='en'&gt;
  
  &lt;head&gt;
   &lt;meta charset='utf-8'&gt;
   &lt;title&gt;my first pdfmake example&lt;/title&gt;
   &lt;script src='pdfmake.min.js'&gt;&lt;/script&gt;
   &lt;script src='vfs_fonts.js'&gt;&lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  
  &lt;input type="text" id="test" name="test"&gt;
  &lt;textarea id="z" cols="10" rows="5" wrap="hard"&gt;&lt;/textarea&gt;
  
  &lt;button onclick="pdf()"&gt;generate&lt;/button&gt;
  &lt;script&gt;
  
      // open the PDF in a new window
      function pdf() {
          var x = document.getElementById("test").value
          var z = document.getElementById("z").value
  
          var docDefinition = {
  
              content: [
  
                  {
                      image: 'sampleImage.png',
                  },
  
                  {  ul: [x] },
                  {
                      image: 'sampleImage.png'
                  },
  
                  {
  
                      ul: [
                             'Item 1',
                             'Item 2',
                             'Item 3',
                          {
                              text: z,
                              bold: true,
                              alignment: 'justify'
                          },
                     ],
  
                  }
                  ],
  
              styles: {
                  header: {
                      fontSize: 18,
                      bold: true,
                      alignment: 'justify'
                  }
              }
          };
          //alert(x);
          pdfMake.createPdf(docDefinition).open();
      }
  &lt;/script&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>THE ERROR:</strong></p>
  
  <p>In the image you can see putting in a long text goes off screen.</p>
  
  <p><a href="https://i.stack.imgur.com/RgTta.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RgTta.png" alt="enter image description here"></a></p>
  
  <p><strong>Is there anyway of fixing that no matter how long the text user enters doesnt go off screen. it goes to the next line?</strong></p>