另存为pdf颜色问题

时间:2020-08-03 17:18:50

标签: html css google-chrome puppeteer

我有以下html:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        
        body {
            margin: 0;
            padding: 0;
        }

        #content {
            height: 5000px;
        }

        #divider {
            width: 1px;
            height: 5000px;
            position: fixed;
            top: 0;
            left: 260px;
            background: black;
            opacity: 0.3;
        }
    </style>
</head>
<body>
    <div id="content">
        
    </div>
    <div id="divider"></div>
</body>
</html>

我试图使用google-chrome打印选项将该内容另存为pdf文件,但我意识到,只要您在页面之间滚动,黑线就会变黑。

这仅在使用opacity选项或#8f8d89之类较浅的颜色(不透明)时发生,它有解释吗?有解决办法吗?

Chrome版本:84.0.4147.105

操作系统:Ubuntu 18.04.4 lts

这是您向下滚动页面时的外观:

enter image description here

enter image description here

enter image description here

谢谢!

0 个答案:

没有答案
相关问题