That error can only occur at doc.close(). Check that you are not ignoring exceptions.
Paulo ----- Original Message ----- From: "Feld, David E" <[EMAIL PROTECTED]> To: <[email protected]> Sent: Wednesday, May 02, 2007 9:31 PM Subject: [iText-questions] ExceptionConverter: java.io.IOException: Thedocument has no pages. Hi, I am receiving the following error: ExceptionConverter: java.io.IOException: The document has no pages. When attempting to call the following code: ByteArrayOutputStream ba = new ByteArrayOutputStream(); Document doc = new Document(); PdfWriter docWriter=PdfWriter.getInstance(doc, ba); PdfDocEvents events = new PdfDocEvents(); docWriter.setPageEvent(events); doc.setPageSize(PageSize.LETTER); doc.setMargins(36, 36, 48, 36); String imageFolder = configuration.getEnvironmentProperty(FwConstants.IMAGE_FOLDER); Image checkMark = Image.getInstance(imageFolder + AppConstants.ICON_CHECK_PDF_IMG); Image logo = Image.getInstance(imageFolder + AppConstants.ACCESS_LOGO_IMG); logo.setAlignment(Image.LEFT); logo.scaleAbsoluteHeight(50); logo.scalePercent(50); SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy hh:mm a"); Date toDay = new Date(); Chunk chunk = new Chunk(logo,0,-45); HeaderFooter header = new HeaderFooter(new Phrase(chunk),false); header.setAlignment(Element.ALIGN_LEFT); header.setBorder(Rectangle.NO_BORDER); doc.setHeader(header); doc.open(); The error occurs when doc.open() is called. This is running in a clustered environment on WAS 6.0. The itext jar is itext-1.2.jar and it was placed in a shared library on the WAS server. We have no idea why this is happening. Please, let me know what I can look at or what I am doing wrong? This is not occuring on the local environment, it is only occuring on this deployed environment. Thanks, David Feld ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ 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/
