IText 2 + Flying Saucer:如何避免图片在两个pdf页面之间断开? [英] IText 2 + Flying Saucer: how to avoid that the images appears broken between two pdf's pages?
本文介绍了IText 2 + Flying Saucer:如何避免图片在两个pdf页面之间断开?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个html文件,我正在使用带有飞碟的Itext 2将其转换为pdf文件。
i have an html file and i'm using Itext 2 with flying Saucer to convert it to a pdf file.
问题是如果图像开始附近页面结束时,飞碟将其中的一部分呈现在当前页面的末尾,其余部分在下一页的开头呈现。
The problem is that if an image starts near the page end, flying saucer render a portion of it it the end of the current page and the rest in the beginning of the next page.
如何说我想要整个图像只在一个页面上?
How to say that i want the entire image on one page only?
推荐答案
你可以将它添加到你的打印css:
You can add this to your print css:
img {
page-break-inside: avoid;
}
用户指南(PDF)提到它。
这篇关于IText 2 + Flying Saucer:如何避免图片在两个pdf页面之间断开?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文