首页 文章

使用wkhtmltopdf时,删除Webkit中的3D插入边框以获取复选框

提问于
浏览
0

Note: 这与删除浏览器中的复选框边框的其他问题不重复 . 这特别适用于wkhtmltopdf中使用的Webkit,而不是谷歌Chrome中使用的 .

我正在使用 wkhtmltopdf ,一个使用webkit引擎的HTML到PDF转换器 .

在生成的PDF中,复选框看起来像这样,带有插入边框:

enter image description here

我希望他们只有一个普通的1px实线边框 .

这是我尝试过的:

input[type=checkbox] {
    border: 1px solid black;
    box-shadow: none;
    /* -webkit-appearance: none; */ /* doesn't work - removes checkbox entirely */
}

令人费解的是,谷歌浏览器也使用了Webkit,但复选框在那里看起来不错 .

有没有其他方法可以改变wkhtmltopdf显示复选框的方式?

1 回答

  • 1

    来自文档:

    --checkbox-checked-svg <path>   Use this SVG file when rendering checked
                                      checkboxes
      --checkbox-svg <path>           Use this SVG file when rendering unchecked
                                      checkboxes
    

    http://wkhtmltopdf.org/usage/wkhtmltopdf.txt

相关问题