Hello all.
Trying insert image into xls file. In resulted xls, image a little bit
stretched.
private static void insertImage(org.apache.poi.ss.usermodel.Workbook
workbook, HSSFCell cell, byte[] imgBytes, int pictureType) {
int pictureIdx = workbook.addPicture(imgBytes, pictureType);
CreationHelper helper = workbook.getCreationHelper();
Drawing drawing = workbook.getSheetAt(0).createDrawingPatriarch();
ClientAnchor anchor = helper.createClientAnchor();
anchor.setCol1(cell.getColumnIndex());
anchor.setRow1(cell.getRowIndex());
anchor.setAnchorType(ClientAnchor.MOVE_DONT_RESIZE );
Picture pict = drawing.createPicture(anchor, pictureIdx);
pict.resize();
}
I am read about Picture.resize() problem method (it works only on Arial
font). How i can set thisFont to my xls file or make work for other fonts
size?
How to solve problem with stretched image?
--
View this message in context:
http://apache-poi.1045710.n5.nabble.com/Image-stretched-while-insert-in-xls-tp5714373.html
Sent from the POI - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]