Hi,
 
It is posible to let a whole paragraph to remain together if a NO_MORE_COLUMN is reached using ColumnText and you change to another column?
 
I'm using the following code:
 
 
    float[] right = {50, 300};
    float[] left = {290, 550};
    int leading = 11;
 
    ct.setSimpleColumn(right[0], 25, left[0], 800, leading, Element.ALIGN_LEFT);

    int column = 0;
    int n_columns = 2;
 
    while(rs.next()) {
      Phrase p = new Phrase();
      p.add(new Chunk("\n" + rs.getString("nombre"), titulo));
      p.add(new Chunk("\n" + rs.getString("direccion") + "\n", direccion));
      ct.addText(p);
 
      if (ct.go() == ct.NO_MORE_COLUMN)
      {
       column++;
       if (column > n_columns - 1) {
        document.newPage();
        column = 0;
       }
 
       ct.setSimpleColumn(right[column], 25, left[column], 800, leading, Element.ALIGN_LEFT);
      }
    }
 
Regards,
Guillermo

Reply via email to