Chrome 打印为带有背景颜色的 PDF

Kar*_*ček 3 printing pdf twitter-bootstrap

我有一个基于 Bootstrap 和 Flat UI css 的页面,我想打印它(保存为 PDF)。

但是不能打印标题颜色和进度条颜色。我在那里看到教程,但没有用。

这是现场演示。

Jay*_*ena 5

看起来像Bootstrap css 中的以下 代码片段导致了这个问题,我只是为我的 .

@media print {
    *,
    *:before,
    *:after {
        background: transparent !important;
        color: #000 !important; // Black prints faster: h5bp.com/s
        box-shadow: none !important;
        text-shadow: none !important;
    }
Run Code Online (Sandbox Code Playgroud)