By Date: <-- -->
By Thread: <-- -->

Contents break pages in pdf



Hello, Bruno, My simple code is this . Can you verify it?

Document doc = new Document();
response.setContentType("application/pdf");

try {
    PdfWriter.getInstance(doc, response.getOutputStream());
    doc.open();

    Table table = new Table(2);
    for (int i=0;i < 110; i++) {
        Cell cell = new Cell("item " + i);
        table.addCell(cell);
    }

    doc.add(table);
               
    doc.add(new Phrase("This comment appears in new page, " +
                       "and must appear under table." +
                       "¿How can i solve this? " +
                       " Is a bug or I'm doing something wrong?"));

}
catch (IOException ex) {
    ex.printStackTrace();
    System.err.println("document: " + ex.getMessage());
}
catch (DocumentException ex) {
    ex.printStackTrace();
    System.err.println ("document: " + ex.getMessage());
}
doc.close();



2006/5/18, bruno <bruno (at) lowagie.com>:
Fer wrote:

>Hello, I have a simple but big problem.
>I create a pdf document, and add contents (for example 2 tables, and
>paragraph). If first content (table1) uses all of page 1 and part of page 2,
>then, next contents always begins in a new page.
>How can i solve this problem?
>
>
If a problem can't be reproduced by us,
it's not a problem. I repeat the remark I have added
to my previous answer (check the mailing list archives):
I'm starting to get really annoyed by the increasing number of
fake (if not fake, completely undocumented) questions on this list.
br,
Bruno



--
Antes de imprimir este mensaje, asegúrese de que es necesario. El medio ambiente está en nuestra mano.