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?
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/