Hi,
I have a situation where a PDFPTable is created iterating on a Java object
containing all data and then it is added to the document object.
Now, I have to make a page break(or create a new page) when a condition is met
while creating the PDFPTable.
If I do document.newPage(), it makes no effect. What am I missing or what do I
need to add ?
Here's my code.
SearchViewBean data = ....
Document document = new Document(.......);
document.open();
PdfPTable pageTable = new PdfPTable(1);
pageTable.setWidthPercentage(100);
pageTable.setSpacingBefore(0f);
createTableData(data, document, pageTable);
document.add(pageTable);
document.newPage();
document.close();
--------------------------
private static void createTableData(SearchViewBean data, Document doc,
PdfPTable pageTable) {
----
----
pageTable.addCell(.....);
If (<some_condition>) {
doc.newPage(); // -- this is having no effect.
}
----
pageTable.addCell(.....);
----
}
Thanks for your help.
Somak
This message contains information that may be privileged or confidential and is
the property of the Capgemini Group. It is
intended only for the person to whom it is addressed. If you are not the
intended recipient, you are not authorized to
read, print, retain, copy, disseminate, distribute, or use this message or any
part thereof. If you receive this message
in error, please notify the sender immediately and delete all copies of this
message.
------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn
about Cisco certifications, training, and career opportunities.
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples:
http://itextpdf.com/themes/keywords.php