I am using Tinymce editor to insert the Body content into pdf report
如果我将表添加到编辑器中并尝试在pdf报告中反映相同的内容,那么最后在pdf-report中添加一个额外的空页面,这只在插入表时没有文本段落,图像等问题
我的邪恶的pdf宝石版本是 wkhtmltopdf(0.1.2) wkhtmltopdf-binary(0.9.9.1)
这适用于Rails2应用
答案 0 :(得分:0)
在 html 代码的最后放置一个 div。喜欢
<% @questions.each do |question| %>
<% if question.id == @questions.last.id %>
<div></div>
<% end %>
<% end %>
或者您可以根据您的代码放置一个 div。
在你的 html.put 中添加一个分区后,在你的 css 中添加以下行:
div.alwaysbreak { page-break-before: always; }
div.nobreak:before { clear:both; }
div.nobreak{ page-break-inside: avoid; }
它对我有用