title: Single page PDF in puppeetersharp
body: <p>I have tried to convert a web page to single page pdf, but there is no support for this. Is there any workaround to achieve this requirement?</p>
  
  <p>I have already tried by setting the pdf page size from html content size. But it is not working as expected for the all the webpage. I have get the html content size using EvaluateExpressionAsync. Below are the code snippets i have tried to achieve my requirement, but not working for all the web pages (mostly responsive webpages).</p>
  
  <pre><code>int height = await page.EvaluateExpressionAsync("document.body.clientHeight");
  </code></pre>
  
  <p>and</p>
  
  <pre><code>dynamic metrics = await Client.SendAsync("Page.getLayoutMetrics").ConfigureAwait(false); 
  
  var width = Convert.ToInt32(Math.Ceiling(Convert.ToDecimal(metrics.contentSize.width.Value))); 
  var height = Convert.ToInt32(Math.Ceiling(Convert.ToDecimal(metrics.contentSize.height.Value)));
  </code></pre>
  
  <p>I have set the above height and width to pdf page size like the screenshot implementation, but the does not work for all the web page. But it is working properly in Screenshot implementation. Can you help me to achieve this?</p>