title: NodeJS: Merge two PDF files into one using the buffer obtained by reading them
body: <p>I am using fill-pdf npm module for filling template pdf's and it creates new file which is read from the disk and returned as buffer to callback. I have two files for which i do the same operation. I want to combine the two buffers there by to form a single pdf file which i can send back to the client. I tried different methods of buffer concatenation. The buffer can be concatenated using Buffer.concat, like,</p>
  
  <pre><code>var newBuffer = Buffer.concat([result_pdf.output, result_pdf_new.output]);
  </code></pre>
  
  <p>The size of new buffer is also the sum of the size of the input buffers. But still when the <code>newBuffer</code> is sent to client as response, it shows only the file mentioned last in the array. </p>
  
  <pre><code>res.type("application/pdf");
  return res.send(buffer);
  </code></pre>
  
  <p>Any idea ?</p>