I use Puppeteer to generate receipts in PDF. For each receipt, width is always the same, but height changes, according to the article count in the order.
For now, I'm using the article count to approximate the required height for my receipt. It kind of works, but it's not perfect and is a dirty way to do (you can notice useless blank space at the bottom of the picture bellow).
Is there way to tell Puppeteer : "Please automatically find the right PDF height, according to the HTML content, in order to NOT generate useless blank space" ?