我正在使用pechkin dll生成一个基于HTML的PDF文件。
这一切都是很好的工作,除了背景色没有呈现。
我使用的HTML的一个例子是:
<table style="border-top: 0px solid black; border-bottom: 2px solid black; background-color: #99ccff; height: 30px; width: 800px;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td><strong>Insured Details</strong></td>
</tr>
</tbody>
</table>生成PDF的代码如下所示:
Dim buf As Byte() = Pechkin.Factory.Create(New GlobalConfig().SetMargins(New Margins(20, 20, 20, 20)) _
.SetDocumentTitle("").SetCopyCount(1).SetImageQuality(100) _
.SetLosslessCompression(True).SetMaxImageDpi(300).SetOutlineGeneration(True).SetOutputDpi(1200).SetPaperOrientation(True) _
.SetPaperSize(PaperKind.A4) _
.SetImageQuality(100) _
.SetPaperOrientation(False)).Convert(New ObjectConfig().SetPrintBackground(True).SetAllowLocalContent(True), strHTML)
Return buf我在网络上看到了一些文章,这些文章似乎表明我的代码应该工作得很好,但事实并非如此。
发布于 2014-11-04 02:58:10
从记忆中,我不得不添加这个来查看背景:
.SetPrintBackground(true)
.SetScreenMediaType(true)https://stackoverflow.com/questions/25477608
复制相似问题