I know that datos is supposed to contain a TIFF. Are you sure? If you save
datos to a file and open it with a graphics program you'll know.

----- Original Message ----- 
From: "Kyrna Margarita Quintanilla Machado" <[EMAIL PROTECTED]>
To: "Paulo Soares" <[EMAIL PROTECTED]>
Sent: Saturday, October 29, 2005 1:13 AM
Subject: Re: [iText-questions] question


> no, actually datos is byte array which I pass to the image object, to get
it
> printed on the generated PDF, datos keeps the byte data from the BLOB
image,
> i dont try to save it into a file, i am just trying to retrieve the BLOB
> column, that contains a TIFF image, then after getting the BLOB column try
> to pass it to the itext as a byte[], i did the same with struts using the
> FormFile object and the getFileData method, that return a byte[], i hope
> that i didnt mess it up with this explanation, BTW thanks for taking time
> and read my last email, Thanks a lot
>
>
> ----- Original Message ----- 
> From: "Paulo Soares" <[EMAIL PROTECTED]>
> To: "Kyrna Margarita Quintanilla Machado" <[EMAIL PROTECTED]>;
> <[email protected]>
> Sent: Friday, October 28, 2005 4:38 PM
> Subject: Re: [iText-questions] question
>
>
> > The question here is if saving datos to a file you are able to open it
> > with
> > a graphics program.
> >
> > ----- Original Message ----- 
> > From: "Kyrna Margarita Quintanilla Machado"
<[EMAIL PROTECTED]>
> > To: <[email protected]>
> > Sent: Friday, October 28, 2005 11:23 PM
> > Subject: [iText-questions] question
> >
> >
> >> l am trying to retrieve a BLOB column from a Oracle table, the colums
> >> contains TIFF image, and i am trying to render this Image from the DB
to
> >> a
> >> PDF,  this is my code, and i get this
> >>
> >> java.io.IOException: Could not find a recognized imageformat.
> >> if (rs.next()) {
> >>     ImagenBlob = rs.getBlob(1);
> >>     int longitud = (int) ImagenBlob.length();
> >>
> >>     ByteArrayOutputStream flujoBytes = new ByteArrayOutputStream();
> >>     byte[] datos = ImagenBlob.getBytes((long) 1, longitud);
> >>
> >>     for (int i = 0; i < longitud; i++) {
> >>         flujoBytes.write((int) datos[i]);
> >>     }
> >>
> >>     Document doc=new Document();
> >>     ByteArrayOutputStream output=new ByteArrayOutputStream();
> >>     PdfWriter writer=PdfWriter.getInstance(doc,output);
> >>
> >>     Image img=Image.getInstance(datos);
> >>     doc.open();
> >>     doc.add(new Paragraph("que paso don waro"));
> >>     doc.add(img);
> >>     doc.close();
> >>     response.setContentType("application/pdf");
> >>     response.setContentLength(output.size());
> >>     output.writeTo(response.getOutputStream());
> >>     response.getOutputStream().flush();
> >> }
> >>
> >>
> >>
> >>
> >>
> >> -------------------------------------------------------
> >> This SF.Net email is sponsored by the JBoss Inc.
> >> Get Certified Today * Register for a JBoss Training Course
> >> Free Certification Exam for All Training Attendees Through End of 2005
> >> Visit http://www.jboss.com/services/certification for more information
> >> _______________________________________________
> >> iText-questions mailing list
> >> [email protected]
> >> https://lists.sourceforge.net/lists/listinfo/itext-questions
> >
> >
> >
> >
>
>
>



-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to