title: Create PDF in Firebase Cloud Functions
body: <p>I am new to javascript and I'm trying to make a PDF file from a firebase function using pdfkit. Below is my function code.  </p>
  
  <pre><code>const pdfkit = require('pdfkit');
  const fs = require('fs');
  
  exports.PDFTest = functions.https.onRequest((req, res) =&gt; {
  
  var doc = new pdfkit();
  
  var loremIpsum = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam in...';  
  
  doc.y = 320;
  doc.fillColor('black')
  doc.text(loremIpsum, {
  paragraphGap: 10,
  indent: 20,
  align: 'justify',
  columns: 2
  });  
  
  doc.pipe( res.status(200) )
  
  });
  </code></pre>
  
  <p>The function starts but then a timeout error happens. 
  Is this the best way of going about creating a pdf file in firebase? 
  I have some html that I want made into a pdf file. </p>