Hi,
Sample code:
Workbook
wb = new Workbook(“Pic2.xlsx”);<o:p></o:p>
Worksheet worksheet = wb.getWorksheets().get(0);
PictureCollection pictures = worksheet.getPictures();
for (int i = 0; i < pictures.getCount(); i++)
{
Picture picture = pictures.get(i);
picture.setData(new byte[] { -119, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 0, 1, 0, 0, 0, 1, 8, 6, 0, 0, 0, 31, 21, -60, -119, 0, 0, 0, 11, 73, 68, 65, 84, 120, -38, 99, 96, 0, 2, 0, 0, 5, 0, 1, -23, -6, -36, -40, 0, 0, 0, 0, 73, 69, 78, 68, -82, 66, 96, -126 });
}
HtmlSaveOptions o = new HtmlSaveOptions();
o.setExportActiveWorksheetOnly(true);
ImageOrPrintOptions io = o.getImageOptions();
io.setImageFormat(ImageFormat.getPng());
wb.save("f:\\files\\out1.html", o);
wb.save("f:\\files\\out2.xlsx");
The issues you have found earlier (filed as CELLSJAVA-42324) have been fixed in Aspose.Cells for Java 17.7.