Thursday, 15 March 2012

java - Keep cell content on one page -


I have a column, with one column. Each cell has paragraphs.

How can I stop the paragraph by splitting into two pages?

  PdfPtable table = new PdfPTable (1); // should be printed as possible table compat form .setSplitLate (wrong); // I can not set together, because the table page size may exceed / /table.setKeepTogether (true); For (Int i = 0; I & lt; 100; i ++) {// Random Text can be ~ 400 characters String Text = "AaAahAaAssaSSSSSSDDFDFFFFF"; Paragraph p = new paragraph (text); // This instruction does not work, I do not know why, because paragraphs in the cell can be printed p.setKeepTogether (right); Table.addCell (P); }  

change

  table.setSplitLate (wrong );  

in

  table.setSplitLate (true);  

In this way, your cell will not be split unless the entire cell fits on one page.


No comments:

Post a Comment