Hi there,

I'm getting the error "insufficient data for an image", when using
acrobat reader 7.0 on a PC.
When using acrobat reader on a MAC or versión 5.0 on a PC, the error
doesn't show up.
I'm using itext-1.4.4.jar and the following code:

Document document = new Document();
ByteArrayOutputStream baos=new ByteArrayOutputStream();
PdfWriter.getInstance(document,baos);
document.open();
PdfPTable mainTable = new PdfPTable(1);
mainTable.setWidthPercentage(98.0f);
                        
Image logo = ITextHelper.getImage("logo.jpg");
logo.scaleAbsolute(300f,120f);
PdfPCell cellLogo=new PdfPCell(logo);
cellLogo.setFixedHeight(logo.scaledHeight()+5);

mainTable.addCell(cellLogo);
document.add(mainTable);
document.close();

response.setHeader("Pragma", "public");
response.setContentType("application/pdf");
int size=baos.size();
response.setContentLength(size);
baos.writeTo(response.getOutputStream());
baos.flush();
baos.close();

Any ideas?

Thanx,
    Rudi.

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to