【问题标题】:White Lines in PDFPDF中的白线
【发布时间】:2013-07-03 06:45:15
【问题描述】:

我正在尝试将 html 表格转换为 pdf 格式。当我在浏览器中查看表格时,没有出现白线,但是当我将其导出为 pdf 时,每个表格单元格和行之间都有白线。我已经尝试了每种 css 样式来解决它,但它们都不起作用。我正在使用 Winnovative HTML 到 PDF 转换器。有没有人遇到过这个问题或知道如何解决?

.pricelistcontainer table {
width: 100%;
display: table;
padding: 0;
margin: 0;
font-size: 100%;
border-collapse: collapse;
/*margin-top: 25px;
margin-left: 52px;*/
border: none;

}

.pricelistcontainer table th {
        border: none;
        background: #000000;
        vertical-align: top;
        color: #ffffff;
        font-family: arial,sans-serif;
        /*line-height: 1.5;*/
        font-weight: bold;
        padding: 4px;
    }



.pricelistcontainer table td {
        /*line-height: 1.5;*/
        border: none !important;
        margin: 0;
        background: #dae2eb;
        vertical-align: middle;
        font-family: arial,sans-serif;
        padding-left: 2px;
        color: #000;
        padding-top: 4px;
        padding-right: 4px;
        padding-left: 4px;
    }

【问题讨论】:

  • 请显示您的 html。您是使用不可见/白色边框还是使用无边框?

标签: c# html pdf pdf-generation


【解决方案1】:

您可以使用dopdf,只需安装它并在网页中按 ctrl + p 即可。它将显示打印选项。选择默认打印机为dopdf并保存。

【讨论】:

    【解决方案2】:

    据我所知,Winnovative 使用 Internet Explorer 渲染引擎,因此您可能需要检查您在 IE 中看到的内容,然后调整您的 CSS。

    或者,您可以使用基于 webkit 的解决方案,例如 wkhtmltopdfhtm2pdf 提供的 API。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-10-02
      • 1970-01-01
      • 1970-01-01
      • 2013-01-18
      • 2016-01-31
      • 1970-01-01
      • 2012-09-04
      • 2019-04-28
      相关资源
      最近更新 更多