title: how to convert pdfkit object into buffer using nodejs
body: <p>I am generating pdf document using pdfkit(nodejs module).i need to convert the pdfkit object to buffer and send response as attachment file without save a file in server. </p>
  
  <p>i was using output function to achieve this:</p>
  
  <pre><code>pdfdocument.output(function(buffer){
      return buffer;
  });
  </code></pre>
  
  <p>pdfkit deprecated the output function.</p>
  
  <p>so right now i dont know how to do
  any idea...</p>