I am using droidText jar for PDF create in my application but i can't re-size image and set text and image in same line. in my code i can get image in pdf but can not set with my size.
ByteArrayOutputStream stream = new ByteArrayOutputStream();
bmimg.compress(Bitmap.CompressFormat.JPEG, 100, stream);
Image myImg = Image.getInstance(stream.toByteArray());
PdfPTable table = new PdfPTable(2);
table.setWidthPercentage(100);
table.setWidths(new int[]{1, 2});
float documentWidth = 100;
float documentHeight = 100;
myImg.scaleToFit(documentWidth, documentHeight);
float leftMargin = doc.getPageSize().getWidth() - myImg.getScaledWidth();
float lMargin = leftMargin / 2 ;
float topMargin = doc.getPageSize().getHeight() - myImg.getScaledHeight();
float tMargin = topMargin / 2 ;
myImg.setAbsolutePosition(lMargin,tMargin);
table.addCell("\n\nRavi Vaghela");
table.addCell(myImg);
doc.add(table);