Discussion:
How to insert page break end of each table in Docx
venkatesh
2018-08-06 06:10:02 UTC
Permalink
i am trying to insert page break end of end page, but my code is not working

XWPFDocument doc = new XWPFDocument(OPCPackage.open(filePath));
int count =0;

List<XWPFTable> tables = doc.getTables();

for (XWPFTable table : tables) {
doc.createParagraph().createRun().addBreak(BreakType.PAGE);
count++;
}

System.out.println("Total tables in doc "+count);



--
Sent from: http://apache-poi.1045710.n5.nabble.com/POI-User-f2280730.html

---------------------------------------------------------------------
To unsubscribe, e-mail: user-***@poi.apache.org
For additional commands, e-mail: user-***@poi.apache.org
Mark Murphy
2018-08-07 15:39:19 UTC
Permalink
This looks like you are creating a page break at the end of the document
for each table in the document. So you will have all your tables, and at
the end of the document, you have a bunch of page breaks.
Post by venkatesh
i am trying to insert page break end of end page, but my code is not working
XWPFDocument doc = new
XWPFDocument(OPCPackage.open(filePath));
int count =0;
List<XWPFTable> tables = doc.getTables();
for (XWPFTable table : tables) {
doc.createParagraph().createRun().addBreak(BreakType.PAGE);
count++;
}
System.out.println("Total tables in doc "+count);
--
Sent from: http://apache-poi.1045710.n5.nabble.com/POI-User-f2280730.html
---------------------------------------------------------------------
Continue reading on narkive:
Search results for 'How to insert page break end of each table in Docx' (Questions and Answers)
12
replies
what is msword?
started 2007-09-09 01:00:25 UTC
programming & design
Loading...