title: How can I create a linearGradient with pdfkit
body: <p>I was looking for and example on how to use linearGradient with pdfkit - see 
  <a href="https://github.com/devongovett/pdfkit/issues/95" rel="nofollow">https://github.com/devongovett/pdfkit/issues/95</a>
  "Use doc.linearGradient and doc.radialGradient to create a gradient object, passing in the required parameters. Then call the stop method on the object to add color stops. Finally, set the fillColor to the gradient object."<br></p>
  
  <p>This is the example I crafted:</p>
  
  <blockquote>
    <p>doc.rect(50, 50, 100, 100)<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.linearGradient(60, 60, 90,
    90)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.stop([100, 100],
    "blue")<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.fillColor("red",
    1)<br></p>
  </blockquote>
  
  <p>But I get a compile error:<br></p>
  
  <blockquote>
    <p>node.js:201<br>
            throw e; // process.nextTick error, or 'error' event on first tick<br> TypeError: Object #&lt;PDFLinearGradient&gt; has no method
    'fillColor</p>
  </blockquote>
  
  <p>'</p>
  
  <p>Thanks!</p>