Ver Mensaje Individual
  #1 (permalink)  
Antiguo 30/11/2012, 20:30
Lamota
 
Fecha de Ingreso: septiembre-2012
Mensajes: 6
Antigüedad: 12 años, 6 meses
Puntos: 0
Pregunta Mostrar imagen en PDF desde bd en JSP

Hola quisiera saber como mostrar una imagen almacenada en bd en un PDf en codigo jsp
Tengo este codigo en una clase llamada PDF
Código jsp:
Ver original
  1. while (rs.next())
  2.      
  3.                                    
  4.                                    
  5.          Blob bin = rs.getBlob("ImgPerro");
  6.                    if (bin != null) {
  7.                   InputStream inStream = bin.getBinaryStream();
  8.                    int size = (int) bin.length();
  9.                   buffer = new byte[size];
  10.                    int length = -1;
  11.                   int k = 0;
  12.                try {
  13.                 inStream.read(buffer, 0, size);
  14.               } catch (IOException ex) {
  15.              ex.printStackTrace();
  16.               }
  17.             if (buffer != null) {
  18.               JOptionPane.showMessageDialog(null,"Respo"+response);
  19.              ServletOutputStream out2 = response.getOutputStream();
  20.                                            
  21.               out2.write(buffer);
  22.                                            
  23.                                            
  24.            cell = new PdfPCell(new Paragraph("Nombre Canino"));
  25.            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
  26.            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
  27.             cell.setBackgroundColor (BaseColor.LIGHT_GRAY);
  28.             tabla.addCell(cell);
  29.                                    
  30.            cell = new PdfPCell(new Paragraph(String.valueOf(rs.getString (10)),fuente10 ));
  31.            tabla.addCell(cell);
  32.                                    
  33.                                    
  34.                                      
  35.           Image im = Image.getInstance(buffer);
  36.                                    
  37.          cell = new PdfPCell(new Paragraph(String.valueOf(im),fuente10 ));
  38.          cell.setRowspan(2);
  39.            tabla.addCell(cell);
La excepcion que me muestra es UnsupportedOperationexception:not supported yet
Gracias