3 строки в начало кода
Код: Выбрать все
Bitmap bmp;
InputStream ims;
ByteArrayOutputStream stream;
и фразу в место вывода рисунка
Код: Выбрать все
try {
// get input stream
InputStream ims = getAssets().open("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.scaleAbsoluteHeight(250);
image.scaleAbsoluteWidth((image.getWidth() * 450) / image.getHeight());
image.setAbsolutePosition(70, 140);
document.add(image);
}
catch(IOException ex)
{
return;
}
если что не получится ,пишите я помогу