1 Reply Latest reply: Nov 29, 2012 6:24 AM by StanislavL RSS

    how to convert a import com.lowagie.text.Image; to a java.awt.image?

      I am trying to convert an itext image to a java.awt image

      ByteArrayOutputStream bas = new ByteArrayOutputStream();
      ImageIO.write((RenderedImage)image, "png", bas);

      byte[] data = bas.toByteArray();

      InputStream in = new ByteArrayInputStream(data);
      BufferedImage finalImage = ImageIO.read(in);

      But at run time i get a ClassCastException.

      Can anyone help me with this?