title: Puppeteer Throwing Invalid Parameters Error
body: <p>I am trying to convert an HTML content to PDF, but I am getting Invalid parameters for scale and preferCSSPageSize when passed using variables.</p>
  
  <p>Error Message:</p>
  
  <blockquote>
    <p>Error: Protocol error (Page.printToPDF): Invalid parameters scale: double value expected; preferCSSPageSize: boolean value expected
        at Promise (/home/santhosh-4759/Downloads/node-v8.11.3-linux-x64/bin/node_modules/puppeteer/lib/Connection.js:202:56)
        at new Promise ()</p>
  </blockquote>
  
  <p>Command Used:</p>
  
  <pre><code>./node puppeteerpdf.js test.pdf 1 false '' '' false false 210mm 297mm 0 0 0 0 false 'htmlcontent'
  </code></pre>
  
  <p>This doesn't work:</p>
  
  <pre><code>await page.pdf({path: output, scale: vcale, displayHeaderFooter: displayHeaderFooter, headerTemplate: headerTemplate, footerTemplate: footerTemplate, printBackground: printBackground, landscape: landscape, width: width, height: height, margin: marginParams, preferCSSPageSize: preferCSSPageSize});
  </code></pre>
  
  <p>This is working:</p>
  
  <pre><code>await page.pdf({path: output, scale: 1, displayHeaderFooter: displayHeaderFooter, headerTemplate: headerTemplate, footerTemplate: footerTemplate, printBackground: printBackground, landscape: landscape, width: width, height: height, margin: marginParams, preferCSSPageSize: false});
  </code></pre>