作者:dsjdsjdsjjk_896 | 来源:互联网 | 2023-07-27 19:25
Imwritingaplug-inforapieceofsoftwarethattakesabigcollectionofitemsandpopsthemint
I'm writing a plug-in for a piece of software that takes a big collection of items and pops them into HTML in a WebView in Cocoa (which uses WebKit as its renderer, so basically you can assume this HTML file is being opened in Safari).
我正在为一款软件编写一个插件,该软件收集大量项目,并将它们在Cocoa的WebView中弹出到HTML中(它使用WebKit作为渲染器,因此基本上您可以假设这个HTML文件正在Safari中打开)。
The DIVs it makes are of dynamic height, but they don't vary too much. They're usually around 200px. Anyway, with around six-hundred of these items per document, I'm having a really rough time getting it to print. Unless I get lucky, there's an entry chopped in half at the bottom and top of every page, and that makes actually using printouts very difficult.
它制作的DIVs是动态高度,但他们没有太多变化。他们通常在200 px。不管怎么说,每一份文档中大约有600个这样的条目,我很难把它打印出来。除非我很幸运,否则每一页的底部和顶部都有一个条目被切成两半,这使得使用打印输出变得非常困难。
I've tried page-break-before, page-break-after, page-break-inside, and combinations of the three to no avail. I think it might be WebKit not properly rendering the instructions, or maybe it's my lack of understanding of how to use them. At any rate, I need help. How can I prevent the cutting-in-half of my DIVs when printing?
我已经尝试过了page-break-before, page-break-after, page-break-inside,以及三者的组合都没有效果。我认为可能是WebKit没有正确地呈现指令,或者可能是我不理解如何使用它们。无论如何,我需要帮助。在印刷时如何防止插页?
8 个解决方案