title: converted text into image using canvas display long text
body: <p>I have seen in a couple of cases of converting text into images but nobody mention that if a text is too long i-e more then 1000 words how can I display them in image with using a font size of 15px <br>
  <strong>my HTML code</strong> </p>
  
  <pre><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;head&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;div id="the_text"&gt;&lt;/div&gt;
  &lt;button id="show_img_btn"&gt;Convert to Image&lt;/button&gt;
  &lt;div id="show_img_here"&gt;&lt;/div&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p><strong>my Script code</strong> </p>
  
  <pre><code>window.onload=function(){
    $("#show_img_btn").on("click", function () {
      var canvas = document.createElement("canvas");
      canvas.width = 620;
      canvas.height = 80;
      var ctx = canvas.getContext('2d');
      ctx.font = "30px Arial";
      var text = $("#the_text").text();
      ctx.fillText(text,10,50);
      var img = document.createElement("img");
      img.src=canvas.toDataURL();
      $("#show_img_here").append(img);
      //$("body").append(canvas);
    });
  };
  </code></pre>
  
  <p>My question is if I convert this image it will converted into one line help me how can i convert the whole text into image and set the height and width. </p>