如何使用itext进行分页 [英] how can I make a page break using itext

查看:631
本文介绍了如何使用itext进行分页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用itext生成pdf。我会在某些时候添加内容以进行分页。我需要插入几个单独的conenidos依赖来源,所以我要求用户在单独的页面上这样做。任何想法???

I want to generate a pdf using itext. I would at some point while the content was added to make a page break. I need to insert several separate conenidos dependence origin so I ask the user to do so on separate pages. Any ideas???

推荐答案

调用 document.newPage()告诉iText将后续对象放在新页面上。只有在放置下一个对象时才会实际创建新页面。此外, newPage()仅在当前页面不为空时才创建新页面;否则,它被忽略了;您可以使用 setPageBlank(false)来克服这一点。

Calling document.newPage() tells iText to place subsequent objects on a new page. The new page will only actually get created when you place the next object. Also, newPage() only creates a new page if the current page is not blank; otherwise, it's ignored; you can use setPageBlank(false) to overcome that.

请参阅以下链接以获取示例:
http://itextpdf.com/examples/iia.php?id=99

Refer below link for an example: http://itextpdf.com/examples/iia.php?id=99

这篇关于如何使用itext进行分页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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