I'm using iText 5.5.9 inside my Android Studio project to make a PDF file.
When I add an image, the transparent parts turn to black inside the PDF.
How can I avoid that?
Here is the part of my code which illustrates the problem:
// add card
Resources res=getResources();
Drawable drawable=res.getDrawable(R.drawable.card);
Bitmap bitmap = ((BitmapDrawable)drawable).getBitmap();
ByteArrayOutputStream stream = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, stream);
byte[] bitMapData = stream.toByteArray();
Image img=Image.getInstance(bitMapData);
img.scaleAbsolute(300f,156.3f);
img.setSmask(false);
doc.add(img);