Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在使用 wkhtmltopdf 生成 PDF 时遇到问题。它与此处描述的情况非常相似,除了前几个图表渲染得很好,但在分页后,每个下一个都呈现没有笔划 - 没有轴,没有刻度,没有图例边框等。然后是其余图表的第三页渲染得很好。
此外 -webkit-border-radius: 1px,此处描述的不起作用:
有谁知道如何解决这个问题?
两天后我发现了问题:
用我的案例演示:
HTML:
<div class="graph"> <div id="chart" style="width: 535px; height:275px;"><!-- chart render here --></div> </div>
和 CSS :
.graph { position: relative; }
不要将 css 位置设置为“相对”,图表在您的 pdf 上将是正确的。如果父 div 不在“相对”上,请检查您的代码。