如何利用itext将结果集中数据分页显示在一个PDF文件中

解决方案 »

  1.   

    网上很多例字的,下个下来看看就行了。      itext好象到1.3.3 版本了,下它的api文档 一看就知道了。换页,它是自动换页,你也可以程序控制
      

  2.   

    利用iText在java程序中生成PDF报表  以下是上述教程中一个最简单的例子,这个例子刻画了通过iText生成PDF文件的一般程序框架。读者只需要在document.open();和document.close();两条语句中间加入自己希望放在PDF文件中的内容即可。该例子只在PDF文件中加了“Hello World“一行文字。
    Document document = new Document(); 
    try
    {
     PdfWriter.getInstance(document, new FileOutputStream ("Chap0101.pdf")); 
     document.open();
     document.add(new Paragraph("Hello World")); 
    }
    catch(DocumentException de)
    {
     System.err.println(de.getMessage());
    }
    catch(IOException ioe) 

     System.err.println(ioe.getMessage());

    document.close();