开发者

Manually inserting page breaks using abcPDF

What's the easiest way to do this? I've done some research and came up with the

<div style="page-break-before:always">&nbsp;</div>

to put in the CSS 开发者_Go百科but I'm not sure how to do this. I'm using it to generate PDF's and I'm looking for a way to start a new page without filling up empty space on a previous one.


Not sure if I understand your concern fully, but creating a page break like that is the way to go.

Let's say you have some markup like:

<div>Some content here that doesn't fill the page</div>
<div style="page-break-before:always">Content here starts on a new page</div>

Then this will cause the second div to appear on a new page. Whether the previous page gets filled or not is upto the contents of the first div (or previous markup until that point).

The only requirement is that second div should not be empty or hidden (this is why you at least need one whitespace character inside the div). But if you have other content (and the content is visible), you don't have to worry about that either.

Hope this makes sense.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜