I am currently using puppeteer to generate PDFs that contain dynamic content.
My goal is to include margins/padding above and below the text on consecutive pages.
Unfortunately, when I try to add margins with the property margin: { top: "1cm", bottom: "1cm" }, it also affects the background color of the page, as this is considered part of the content receiving the margin property.
Is there a way to specifically apply margins/padding only to the text itself? Since the data is generated dynamically, adding the padding property directly to the content is not an option.
Shown below are screenshots of the PDF without margins and with margins applied: