Wkhtmltopdf单行中的字符在页面之间部分切割 [英] Wkhtmltopdf Characters in single line partially cut between pages

查看:866
本文介绍了Wkhtmltopdf单行中的字符在页面之间部分切割的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在一个项目中使用Ruby on Rails(3.1)。我的要求是从html内容生成pdf。所以我使用pdfkit gem。



在一些页面中,单行中的字符在页面之间部分切割。当我使用pdfkit gem将html转换为pdf格式



wkhtmltopdf版本: wkhtmltopdf - 0.11.0 rc1



操作系统: Linux CentOS 5.5



在下面的图片中,显示了在页面间部分剪切的字符。



请提出解决方案。



示例1


示例2



解决方案

我刚刚遇到了这个问题,并找到了解决问题的方法。在我的特殊情况下,有div display:inline-block; margin-bottom:-20px; 。一旦我改变它们以阻止并重置边缘底部,线分裂消失。 YMMV。


I am working in a project using ruby on rails(3.1). My requirement is to produce pdf from the html content. So I use pdfkit gem.

In some pages, characters in single line partially cut between pages. When I convert html convert to pdf using pdfkit gem

version of wkhtmltopdf: wkhtmltopdf -- 0.11.0 rc1

operating system: Linux CentOS 5.5

In the image below showing character partially cut between pages.

Please suggest a solution.

Example 1

Example 2

解决方案

I just ran across this and found something that resolved the issue for me. In my particular case, there were divs with display: inline-block; margin-bottom: -20px;. Once I changed them to block and reset the margin-bottom, the line splitting disappeared. YMMV.

这篇关于Wkhtmltopdf单行中的字符在页面之间部分切割的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆