how can I make a page break using itext

后端 未结 2 1090
太阳男子
太阳男子 2020-12-10 10:55

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 s

相关标签:
2条回答
  • 2020-12-10 11:13

    For iText7 try:

    document.add(new AreaBreak());
    

    Source: http://itextsupport.com/apidocs/itext7/7.0.0/com/itextpdf/layout/element/AreaBreak.html

    0 讨论(0)
  • 2020-12-10 11:17

    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.

    Refer below link for an example: http://itextpdf.com/examples/iia.php?id=99 (Edit: dead 404)

    0 讨论(0)
提交回复
热议问题