Thanks for your answer Dave, but the document I�m trying to print has lots of information and it runs ok in my dev environment. When I try to run it in my Application Server (Oracle 9i AS) I get this lovely message "document has no page".
 
Here is my code:
 
Document document = new Document (PageSize.A4, 50,50,50,50);
 
        ByteArrayOutputStream out = new ByteArrayOutputStream();
       
   
        PdfWriter writer = PdfWriter.getInstance(document, out);           
        
        document.open();           
       
        Paragraph DadosPessoais = new Paragraph("Dados pessoais",FontFactory.getFont(FontFactory.HELVETICA, 15, Font.BOLD));
 
        DadosPessoais.setAlignment(DadosPessoais.ALIGN_LEFT); 
               
        document.add(DadosPessoais); 
                                
        document.close();
 
        HttpServletResponse response = context.getServletResponse();
 
        response.setHeader("pragma", "no-cache");
        response.setHeader("cache-control", "no-cache");
        response.setContentType("application/pdf");
       
        response.setContentLength(out.size());
       
        response.getOutputStream().write( out.toByteArray() );
 
        response.flushBuffer();
 
       

       
 
 
----- Original Message -----
Sent: Thursday, October 21, 2004 9:52 PM
Subject: RE: [iText-questions] URGENT HELP

A pdf document must have a page and the page must have something on it. So if that is your problem, for a blank document create a page and put a space on it.

 

- dave

 

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Gilberto Sousa
Sent: Thursday, October 21, 2004 4:05 PM
To: [EMAIL PROTECTED]
Subject: [iText-questions] URGENT HELP

 

I�m in deep trouble using the iText software.

When I used iText I have no problems in OC4J, my dev environnement.
But when i deploy it to Oracle9ias, (copying the iText.jar in WEB-INF/lib/)
it makes me the next error when i run:
"The document has no pages. "

I�ve been reading some answers for this problem, but all of them are incomplete, and I also don�t know if the solution worked.

This is a server configuration problem, or is there something I can do in my code?
I know some of you had the same problem, please tell me what to do.


Thanks in advance.

Reply via email to