Hi,
    I generated all the PDF file using iText-2.0.7.  But  I faced some trouble  
last few days on generating PDF
 file in WSAD 5 as wel as WAS 5.1. After generating  some  PDF file (some time 
in first request and some after 2-4 request)  I got - java.io.IOException: The 
document has no pages exception.But the same code working fine with RAD - 6.
   So I search in Google and after go through the some post I thought of may be 
JRE issue So I replace the itext jar by version 1.3. But  problem  till  
persists. 


String funcGenInvoice(){

        Document document = new Document();
        String fileName = 
String.valueOf(parameters.get("Invoice_AccNbr"))+"_Summary"+new  
                   SimpleDateFormat("dd.MM.yyyy.hh.mm.ss").format(new 
Date())+".pdf";
        
        try{
            
        ConfigManager configManager = new             
       ConfigManager(ConfigPropertiesKeys.CONFIG_FILE_NAME);        
        String tempFolder = configManager.getProperty("output.path");
        tempFolder=tempFolder+"/tempinvoice";
        File file = new File(tempFolder);
        file.mkdirs();    

        PdfWriter writer =PdfWriter.getInstance(document,new 
FileOutputStream(tempFolder+"/"+fileName));
       
        document.open();
        document.setPageSize(PageSize.A4);
        document.newPage();    

        
        PdfPTable table2 = new PdfPTableExtention(1);
        table2.setWidthPercentage(100);
        table2.getDefaultCell().setBorder(PdfPCell.NO_BORDER);
        PdfPCell last = new PdfPCell(new 
Paragraph("\n"+parameters.get("Invoice_Note").toString(),tableDefaultFont));
        last.setBorderWidthBottom(0);
        last.setBorderWidthTop(0);
        last.setBorderWidthRight(0);
        last.setBorderWidthLeft(0);
        table2.addCell(last);
        document.add(table2);
        
        document.close();

      }catch(Exception e){
            e.printStackTrace();
            fileName = null;
      }    
      return fileName;
      
 }  
    
    Please help me.

    Thanks in advance.

    Subhas



      Now you can chat without downloading messenger. Go to 
http://in.messenger.yahoo.com/webmessengerpromo.php
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to