I want to set Image in pdf.i use iText for set Image in pdf.I Succsessfully Diaplayed image From Assets folder.But I want To display Image from sd card path. following is code for display image from assets folder.
try { InputStream ims = con.getAssets().open("prof_image.png"); Bitmap bmp = BitmapFactory.decodeStream(ims); ByteArrayOutputStream stream = new ByteArrayOutputStream(); bmp.compress(Bitmap.CompressFormat.PNG, 100, stream); Image image = Image.getInstance(stream.toByteArray()); image.setAlignment(Image.ALIGN_RIGHT); cell.addElement(image); //cell.setHorizontalAlignment(Element.ALIGN_CENTER); //alignment //cell.setBackgroundColor(new GrayColor(0.75f)); //cell background color cell.setFixedHeight(60); //cell height table.addCell(cell); } catch (MalformedURLException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); }