diff --git a/nbconvert/exporters/webpdf.py b/nbconvert/exporters/webpdf.py index a87aa2cdb..512b37bfc 100644 --- a/nbconvert/exporters/webpdf.py +++ b/nbconvert/exporters/webpdf.py @@ -103,6 +103,7 @@ async def main(temp_file): raise RuntimeError(msg) from e page = await browser.new_page() + await page.emulate_media(media="print") await page.goto(f"file://{temp_file.name}", wait_until="networkidle") pdf_params = {"print_background": True}