I already create table and some extra information as a PDF. But I couldn't import image to my PDF whatever I did. I have my_thumb.png file in assets folder.
in my MainActivity class
try { inputStream = MainActivity.this.getAssets().open("my_thumb.png"); Bitmap bmp = BitmapFactory.decodeStream(inputStream); ByteArrayOutputStream stream = new ByteArrayOutputStream(); bmp.compress(Bitmap.CompressFormat.PNG, 100, stream); model.setThumbStream(stream); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } in my CreatePDF class
Image thumb = Image.getInstance(Model.getThumbStream().toByteArray()); companyLogo.setAbsolutePosition(document.leftMargin(),121); companyLogo.scalePercent(25); document.add(thumb); and the problem is
bmp.compress(Bitmap.CompressFormat.PNG, 100, stream); this line returns with null.
What is the point that I missing?
Thanks in advance.